glsl_analyzer icon indicating copy to clipboard operation
glsl_analyzer copied to clipboard

Representation of function overloads in completions

Open automaticp opened this issue 1 year ago • 4 comments

Hey, I wanted to clarify one thing about the behavior of completion on overloads. Currently (v1.3.2), there's a duplicate entry for each function overload:

image

I think this is mostly noise and impacts discoverability. Could we maybe consolidate this into a single entry, since the documentation for each overload is still available through hover?

For reference, this is how clangd does this:

image

Where it says [N overloads] and provides docs for one of them. Now, clangd has full type information, so it can select the right overload on hover:

image

But it also supports signatureHelp (something that's worth considering for glsl_analyzer) to scroll through overloads:

image

For the current state of glsl_analyzer, I think it would help to remove duplicates in completions, but keep the documentation for each overload on hover, so that it's still accessible.

Once type information is available, we can also give the docs for the right overload on hover. The signatureHelp could be added without type info for discoverability already, but it won't be able to show the "right/current" overload.

automaticp avatar Oct 20 '23 14:10 automaticp