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

error-column matching #81

wants to merge 4 commits into from

Conversation

FrostKiwi
Copy link

@FrostKiwi FrostKiwi commented Sep 13, 2024

Until now, glslangValidator did not output error columns, so vscode-glsllint displayed the error at the start of the line, in column 1.
Thanks to @antaalt and his KhronosGroup/glslang#3614, we now have the error column reported by glslangValidator. This Pull Request adds compatibility for this.

Before this PR (or without --error-column) This PR
image image

Functionality

If you have updated glslangValidator to a version that supports this, you can specify --error-column among glsllint.glslangValidatorArgs. Like this: "glsllint.glslangValidatorArgs": ["--error-column"]

Since there is no official release version yet, nightly builds of glslangValidator can be had here: https://github.com/KhronosGroup/glslang/releases/tag/main-tot

If --error-column is among the arguments, a new regex is used to pull the column and display the error squiggly accordingly.

@antaalt
Copy link

antaalt commented Sep 13, 2024

Nice work, I had some code in local to test it, it could be even better to use an optional regex group for the column tag in order for the regex to support both log format without having to care if glslang support the option, such as /(WARNING|ERROR):\s+(\d|.*):(\d+):(?:(\d+):)\s+(.*)/, this way, no need to check for the option support, and it will work for both versions of glslang

@FrostKiwi
Copy link
Author

FrostKiwi commented Sep 13, 2024

it could be even better to use an optional regex group for the column tag in order for the regex to support both log format without having to care if glslang support the option, such as /(WARNING|ERROR):\s+(\d|.*):(\d+):(?:(\d+):)\s+(.*)/

Didn't consider this. A good change, I added it and removed the check for the --error-column argument. I had to modify the regex some more, because it kept matching against stdin in the non---error-column case. Code got definitely simpler 👍

Hope to address that vscode-glsllint only matches the first error and ignores the rest of the errors in a following PR.

@hsimpson
Copy link
Owner

@FrostKiwi thanks for the PR, I will have a look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants