Jacajack / vscode-glsl-linter

GLSL linter for Code
5 stars 1 forks source link

Linter cannot find Validator after Validator path setting done ! #5

Closed 1216892614 closed 2 years ago

1216892614 commented 3 years ago

I have unziped glslangValidator in .vscode\extensions\mrjjot.vscode-glsl-linter-1.2.0 (Win64).Then I set Validator path in VSCode Setting.But my linter just don`t work,output"GLSL Linter: failed to run GLSL validator!"after every Ctrl+S.

{
    "workbench.colorTheme": "Solarized Dark",
    "files.autoSave": "afterDelay",
    "glsl-linter.validatorPath": "C:\\Users\\usr\\.vscode\\extensions\\mrjjot.vscode-glsl-linter-1.2.0\\glslangValidator",
    "editor.formatOnSave": true,
    "editor.fontFamily": "Fira Code,Consolas,'Courier New',monospace",
    "editor.fontLigatures": true,
    "glsl-linter.validatorArgs": n

    ull
}

I download Validator from [ https://github.com/KhronosGroup/glslang/releases/download/master-tot/glslang-master-windows-x64-Release.zip ] The setting steps i folowed is https://zhuanlan.zhihu.com/p/151384233

Jacajack commented 2 years ago

Hi,

It seems that this configuration isn't valid. Please either remove the validatorArgs setting completely or remove the whitespace after "n", so it reads null. Also, I'm not sure how windows goes about running executable files, but maybe try adding .exe to the validator path. Please make sure that the path is valid too.

Hope this helps. Sorry for the late response, but I was away from home this week.

1216892614 commented 2 years ago

sorry for my late . In my test,fixed"null" and both \bin and .exe path can not help.I still can not use validator.

Jacajack commented 2 years ago

That's interesting. When you run cmd.exe and type in:

C:\Users\usr\.vscode\extensions\mrjjot.vscode-glsl-linter-1.2.0\glslangValidator

does the validator run?

1216892614 commented 2 years ago

its work.Thats strange.

 hndpp@DESKTOP-DITUETB          bin  .\glslangValidator.exe
Usage: glslangValidator [option]... [file]...

'file' can end in .<stage> for auto-stage classification, where <stage> is:
    .conf   to provide a config file that replaces the default configuration
            (see -c option below for generating a template)
    .vert   for a vertex shader
    .tesc   for a tessellation control shader
    .tese   for a tessellation evaluation shader
    .geom   for a geometry shader
    .frag   for a fragment shader
    .comp   for a compute shader
    .mesh   for a mesh shader
    .task   for a task shader
    .rgen    for a ray generation shader
    .rint    for a ray intersection shader
...
1216892614 commented 2 years ago

The only error i got is from my VSCode

GLSL Linter: failed to run GLSL validator!

PS:Path is changed in VSCode json befor last comment

Jacajack commented 2 years ago

Hm, and what happens if you replace all \ with / in your validatorPath? Maybe the command is ran in some internal UNIX shell emulator or something? Given that the path is correct, I don't really have more ideas what could be wrong

1216892614 commented 2 years ago

but my json is:

"glsl-linter.validatorPath": "C:\\Users\\usr(true path is my username here.)\\.vscode\\extensions\\glslang-master-windows-x64-Release\\glslangValidator.exe",

That is written by VSCode setting gui.

Jacajack commented 2 years ago

Yes, but can you try what happens if you use

"glsl-linter.validatorPath": "C:/Users/usr(true path is my username here.)/.vscode/extensions/glslang-master-windows-x64-Release/glslangValidator.exe",

instead?

1216892614 commented 2 years ago

It still do not wor.I don't have more idea too , software is be reinstall for many times

Jacajack commented 2 years ago

There's one more thing that comes to my mind. Can you try this extension: https://marketplace.visualstudio.com/items?itemName=CADENAS.vscode-glsllint and see if it works? If it does, this means that the problem lies in my extension. If it doesn't - probably something is wrong with your Code installation.

1216892614 commented 2 years ago

I'll try later.

1216892614 commented 2 years ago

That extension is work on my VSCode just after validator path set.

Jacajack commented 2 years ago

Alright then. I'll try to reproduce this error on my Windows PC later and let you know if I find out anything.

Jacajack commented 2 years ago

Hi again. I still haven't had a chance to try to reproduce this issue on my Windows machine, but I have a new suggestion.

Today I learned that Windows sometimes likes to cause problems with paths if your username contains non-ASCII characters. Does your contain such? Can you please try installing the glslangValidator.exe at a "simpler" location, maybe something like C:\glslangValidator\glslangValidator.exe and then try to run it from Code?

1216892614 commented 2 years ago

error:GLSL Linter: GLSL validator returned exit code 1! path:C:\glslang-master-windows-x64-Release\bin\glslangValidator.exe PS:\ is \\ in json,and i think where problem is in validatorArgs.

Jacajack commented 2 years ago

Okay, so that's good. At least we know that it's running now and the problem was related to the first path you used.

So what is your validatorArgs? Did you set up the file extensions in fileExtensions? Please take a look here.