Search code examples
syntax-errorglslvscode-extensionslint

VSCode extensions "GLSL Lint" and "glsl linter" don't find errors with .frag code even when there are problems


I'm new to coding and even newer to shader code. I've made a file, test.frag to test if my setup is working correctly. I have code snippets working but linting doesn't seem to work.

Code with errors where errors are not detected

#ifdef GL_ES
precision mediump float;
#endif

void main(){
    gl_FragColor = vec4(1.0 0.3, 0.9, 1.0)
    
}

Here the errors are a missing ; character at the end of the line and a missing , comma character to separate the arguments of the vec4. The linters don't seem to find any errors though for some reason

I'm not getting any errors from the linters on startup, and i'm pretty sure i set up the validator-paths correctly

settings.json glsl linting validator paths

"glsl-linter.validatorPath": "D:\\D_Programfiles\\Bonus VSCode stuff\\glslang-master\\bin\\glslangValidator.exe",

"glsllint.glslangValidatorPath":"D:\\D_Programfiles\\Bonus VSCode stuff\\glslang-master\\bin\\glslangValidator.exe",

is it because i chose a separate drive? Maybe the spaces in the folder names? I don't know, but the extensions aren't reporting any errors? I'm also using the shadertoy extension to display the shader.

According to this video tutoriel the linter should be able to find an error in the code.

I've tried uninstalling and reinstalling VSCode, and it didn't help. I've also tried running the linters both separately and together, neither helped. I've also looked into some stackoverflow and reddit posts but i couldn't find this specific error (non error?), nor anything about it.

I've tried deleting every file and folder except the folder im running and the test.frag file. Image of the test.frag file

I have not tried to configure either linter beyond setting the validation-path.


Solution

  • Switching to a different linter solved the problem.

    The linters i used would only work as intended when you save the file or close and re-open it.

    Switching to the WebGL GLSL Editor extension solves the problem and provides live feedback on errors, and it doesn't require you to set a validation-path either