nolanderc / glsl_analyzer

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

Bad formatting for `attribute` and `varying` #4

Closed vdrn closed 10 months ago

vdrn commented 10 months ago

This code:

attribute vec4 color0;
varying vec4 color;
void main() {}

gets formated as:

attributevec4 color0;
varyingvec4 color;
void main() {}
nolanderc commented 10 months ago

I pushed a quick fix. I missed the part of the spec that says that these are valid type/layout qualifiers, which caused them to be parsed as invalid syntax trees. To safeguard against future issues such as this, we now emit a space after any invalid syntax.

A new release is in the pipeline and should be up in a bit.

vdrn commented 10 months ago

Awesome, the issue is fixed. As a side note, completions and goto for #defines are working great as well! Thanks so much!