racz16 / WebGL-GLSL-Editor

WebGL GLSL shader editor extension for Visual Studio Code.
Other
97 stars 12 forks source link

[Bug]: Diagnostics does not show errors / show red lines #63

Closed DisparueStrix closed 1 month ago

DisparueStrix commented 1 month ago

The extension's version

1.3.8

VS Code's version

1.92.0

Extension host

Desktop VS Code

Operating system

Windows 11 x64

Description

Hi

Error reporting doesnt work. No matter what is inputted, no red lines / errors are shown. This has been tested on a fresh VSCode install with no other add ons active. Even after compiling the latest version of glslangValidator (11:14.3) and manually replacing yours (8.13.3559) in your extensions directory it didnt make a difference.

Let me know if you need anymore information.

Regards.

racz16 commented 1 month ago

Hi, thank you for reporting your problem. I suspect diagnostics don't work because the file extension is .glsl. glslang needs to know the shader stage (like vertex shader, fragment shader, etc.), to be able to compile the source code. If you use extensions like .vert, or .frag, it's clear what the shader stage is. I recommend only using the .glsl extension if you use the file in multiple shader stages. If the file extension is .vert, or .frag, it is a bug.

DisparueStrix commented 1 month ago

Hi, thanks for the quick reply.

The file extension I normally use is .vs / .fs, but even after changing to .vert / .frag the problem persists.

Regards.

racz16 commented 1 month ago

Hmm, that's very strange. The .vs, and .fs extensions are as good as the .vert, and .frag, so it shouldn't make a difference. Honestly, I don't have a lot of ideas. I use the same version of the extension and VS Code on Windows and it works fine, so I think the problem is on your side. Do you use any other shader-related extensions? Is it possible, that you don't have permission to run glslang? Do the other features, like code completion, go to definition, etc. work? If you open the Output panel and switch to the Extension Host channel, can you see any logs related to the extension? Or if you have a WebGL GLSL Editor channel, are there any logs there?

DisparueStrix commented 1 month ago

Hi, thanks for the quick reply.

No extension log problems but I have found the cause of it and was able to reproduce. My current account has my user name as Maestro Strix so to access it you would need to go to C:\Users\Maestro Strix, with a space. I created two new user accounts now one with a single name Maestro and one called Maestro Two. After installing vscode on both user profiles along with your extension, I noticed diagnostics doesnt work for user accounts with a space in it. I had a hunch it was this. However, I am not familiar with your project to know where or what I can do to fix the issue. After changing my user profile to Maestro_Strix, with an underscore and no space, your extension works fine without issues.

Regards.

racz16 commented 1 month ago

Oh, okay, now I understand. When I run glslangValidator, I just concatenate the glslangValidator's path with the command line arguments. But of course, if the Windows user name contains a space, it'll interpret part of the path as command line arguments. I wrapped the path with quotation marks, and now it works (3f53597cd1544b78b5d9a199e44807cbecb055fa). It'll be part of the next release.

DisparueStrix commented 1 month ago

Nice. To be fair, people dont normally create user profiles with space in it, this is actually the first time in my life that I had which is even odd for me.

Anyway thanks for the future fix and thanks for the extension too. There arent a lot of WebGL tools out there and this by far is the best one.