danielscherzer / GLSL

VSIX Project that provides GLSL language integration.
255 stars 27 forks source link

External compiler doesn't show any error #29

Closed liurui39660 closed 5 years ago

liurui39660 commented 5 years ago

Installed product versions

Description

I believe there is something wrong with my configuration, not the extension itself, but I can't figure out.

I set the "File Path to external compiler executable" as C:\Program Files\Shader Validator\glslangValidator.exe, and purposely make some grammar mistakes in my shader files, but it doesn't show the error squiggles, the error list is also empty.

No matter I quote the file path (I noticed there are spaces) or not, it is the same.

Other settings are left default, "Live Compiling" is True, "User Key Words" is empty.

I tried to save the file, still no change.

My shader file names are "1.vert", "1.frag". Here is the example content.

#version 450
in vec3 location;
void main() {
    gl_Position = location;
}

The location and gl_Position are not the same type which should cause an error.

Please tell me if additional logs are required.

Steps to recreate

  1. Set "File Path to external compiler executable" to the location of your glslangValidator.exe
  2. Paste the sample code to a file named 1.vert
  3. Save it
  4. Wait for the error squiggles

Current behavior

No squiggles, no error, no warning.

Expected behavior

Show something like this

ERROR: 0:4: 'assign' :  cannot convert from ' in 3-component vector of float' to ' gl_Position 4-component vector of float Position'
ERROR: 0:4: '' : compilation terminated
ERROR: 2 compilation errors.  No code generated.

This is the output of glslangValidator.exe executed via cmd.

danielscherzer commented 5 years ago

Hi! I cannot replicate this behavior! If I follow your instructions I get

grafik

in Visual Studio as expected. I tried D:\Daten\downloads\glslang test\bin\glslangValidator.exe as a path with spaces. Do you get the expected squiggles when you set the external compiler setting to "" (empty)?

liurui39660 commented 5 years ago

Thanks for reply.

I just tested it on my personal laptop, with the same settings exported from my working PC (where I found the problem). There is no such issue, even there are spaces in the path.

I tried no-space path, like C:\Users or even leave it empty, neither would work.

My working PC has lots of problems (because we can't update to latest build), e.g. can't install .NET 4.7. I don't know if this would affect.

I think it would help if there is a debug output window or a log file so I can tell where the problem is. Can you tell me how to find them?

danielscherzer commented 5 years ago

I updated the extension to write exception information to the visual studio status bar if executing the external compiler fails. Hope this helps.

liurui39660 commented 5 years ago

Hi, thanks for your kind assistance.

I just tested it on both of my PCs. For my laptop (control group), the errors are underlined correctly. If I use an invalid path for the external compiler, the exception also shows on the status bar.

Then I tested it on my working machine. The first problem is when I clicked "update", it downloaded and scheduled the newer version, but it didn't actually update after I close the visual studio. When I open it again, it remained the old version.

To solve this problem, I uninstalled and reinstalled the extension. Then I purposely make some mistakes in my shader code. Nothing was shown. I wonder if the extension is not executed at all. But the code completion and highlighting worked very well.

Note that the both the external compiler and the code (a whole C++ project) are shared through OneDrive, so it is guaranteed files used are exactly the same.

danielscherzer commented 5 years ago

I'm not quite sure how to debug your error. Are after reinstalling any exceptions from the extension shown?

liurui39660 commented 5 years ago

Sorry for forgetting to reply.

I tried to reinstall the extension. But still, neither the internal nor the external compiler works.

I'm not sure if it's due to the lack of .NET 4.7, since it indeed caused lots of problems on my working PC. However, the Windows Update of my working PC is disabled by the admin, so it is kept on a very old Windows 10 build, and can't install .NET 4.7.

Really thanks for helping. Though it still not works for now, at least the syntax highlight and completion can work. I can try to do the syntax checking with some extensions on VSCode.