nolanderc / glsl_analyzer

Language server for GLSL (autocomplete, goto-definition, formatter, and more)
GNU General Public License v3.0
154 stars 3 forks source link

Linting and GLSLANG integration #18

Open GabeRundlett opened 9 months ago

GabeRundlett commented 9 months ago

Hi y'all! I recently started a similar project because I noticed that GLSL didn't have good language integration into VSCode. Language stuff isn't my forte, so I forked a project to get to where I am at now, which is a very minimally working language server, along side a minimal language server vscode extension which I achieved by paying a friend of mine to develop. But it looks like you guys are much more experienced or at least knowledgeable on this subject so I wanted to see if there's anything I can do to assist in the development of this LSP and extension.

One thing my project has is support for compiling via glslang, making compilation errors show up directly in the editor. I would be willing to looking into integrating such a feature into your project, since yours seems much more featureful. I recently spent some time learning Zig, so that's a nice coincidence 😅. I'd love it if I could have an editor that integrates with my Vulkan abstraction in such a way that the same GLSLANG compile commands that are used for compiling shaders in-engine are also used by the extension to show compilation errors, and so they know include paths and such.

Great work on this extension!!

nolanderc commented 8 months ago

Hi! Glad to hear there are more people interested in this domain :smile:

Ideally, we would generate our own diagnostics, but that is probably quite far away from being complete (basic things such as syntax errors are generated, but never shown to the user currently). However, better diagnostics is one of the goals of the name-resolution/type-checker rewrite I'm planning.

Until then, having the ability to automatically collect diagnostics from a background process running glslc or glslangValidator would be nice! Of course, this assumes the user has these programs installed on their machine. Another approach would be to integrate the glslang library, as we did in glslls. However, I'm not to keen to add it as a dependency as I found it quite obnoxious to work with, and it would complicate the build system.

jansol commented 2 months ago

Assuming the syntax errors are correct it would be nice to show them already, even if they lack type checking etc. Any diagnostics are better than no diagnostics.