Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error-column matching #81

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to the "vscode-glsllint" extension will be documented in thi

Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.

## [1.9.1]

### Added

- Since https://github.com/KhronosGroup/glslang/pull/3614, glslangValidator now outputs the error column as well. If `--error-column` is given among `glslangValidatorArgs`, then glsllint will display glsl errors under the correct column, not just at the start of the line

## [1.9.x]

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vscode-glsllint",
"version": "1.9.0",
"version": "1.9.1",
"publisher": "dtoplak",
"repository": {
"type": "git",
Expand Down
12 changes: 8 additions & 4 deletions src/features/glsllintProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,15 @@ export class GLSLLintingProvider {
}

if (severity !== undefined) {
const matches = line.match(/(WARNING|ERROR):\s+(\d|.*):(\d+):\s+(.*)/);
if (matches && matches.length === 5) {
const matches = line.match(/(WARNING|ERROR):\s+([^:]+):(\d+)(?::(\d+))?:\s+(.*)/);
let errorcolumn = 0;
if (matches && matches.length === 6) {
if (matches[4] !== null) {
errorcolumn = parseInt(matches[4]);
}
const errorline = parseInt(matches[3]);
const message = matches[4];
const range = new vscode.Range(errorline - 1, 0, errorline - 1, 0);
const message = matches[5];
const range = new vscode.Range(errorline - 1, errorcolumn, errorline - 1, errorcolumn);
const diagnostic = new vscode.Diagnostic(range, message, severity);
diagnostics.push(diagnostic);
}
Expand Down