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 hover hints for parameters in the interface blocks #8

Closed automaticp closed 10 months ago

automaticp commented 10 months ago

glsl_analyzer v1.0.8

The hover hint seems to confuse the parameters between in and out interface blocks as the same variable if their names match.

The snippet:

#version 430 core

in Interface {
    vec2 tex_coords;
} in_[3];

out Interface {
    vec4 frag_pos;
    vec2 tex_coords;
} out_;

void main() {
    out_.tex_coords;
}

The hint I get:

image

automaticp commented 10 months ago

Btw, sorry, by matching names I meant the names of the parameters, not the interface blocks themselves. This still happens if the blocks have different names.

nolanderc commented 10 months ago

Unfortunately, I haven't implemented field-completions for named interface blocks, so this is expected: the fields are treated as globals. I have been meaning to rewrite the name-resolution/type-checking to something less hacky. But until then I guess another hack could do the trick :shrug:

nolanderc commented 10 months ago

This should be fixed in v1.0.10