You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For completions, currently gopls sets filterText to the prefix-trimmed completion candidate. For example when completing at fmt.P<> you will get back a candidate with label of "Print(...)" and a filterText of "rint". This breaks lsp-mode in emacs because "P" does not match the filter text "rint".
I surveyed some other clients/servers regarding filterText:
java/rust/python servers don't set filterText
clangd sets it, but does not trim the prefix
vscode seems to match using the label or filterText, so you can mix and match from either (that is why the trimmed prefixes don't break vscode). the lsp spec seems to suggest filterText should supersede label if present, but maybe vscode does this to be more lenient in general.
sourcekit-lsp sets it, but doesn't seem to filter the candidates at all based on the already-typed prefix
I haven't found any hard evidence saying filterText must include the full identifier, but at this point I think gopls should not trim the prefix.
The text was updated successfully, but these errors were encountered:
Sorry for not responding to this earlier. The reason I set the filterText is specifically because of the behavior of VSCode. The example I found was this:
I have 2 variables in scope item and insertText. Without filter text, I type i and get suggestions for both variables, then I add the t and only see suggestion for insertText because of the VSCode filtering on the label. However, when I set filterText, the behavior is as I would expect.
Breaking this out from #31178 (comment)
For completions, currently gopls sets
filterText
to the prefix-trimmed completion candidate. For example when completing atfmt.P<>
you will get back a candidate withlabel
of "Print(...)" and afilterText
of "rint". This breaks lsp-mode in emacs because "P" does not match the filter text "rint".I surveyed some other clients/servers regarding filterText:
I haven't found any hard evidence saying
filterText
must include the full identifier, but at this point I think gopls should not trim the prefix.The text was updated successfully, but these errors were encountered: