filterText requires trimmed prefixes
See original GitHub issueIn gopls
, we originally did not set filterText for completions, but we encountered an issue that required us to return prefix-trimmed filter text. I wonder if we could do the prefix-matching client-side, since none of the other editors seem to require prefix-trimmed filter text.
Repro case:
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 filtering on the label. However, when I set filterText with trimmed prefixes (tem
and nsertText
), the behavior is as I would expect, i.e., both variables are matched.
Relevant issues: https://github.com/golang/go/issues/31552, https://github.com/Microsoft/language-server-protocol/issues/729, https://github.com/tigersoldier/company-lsp/issues/103.
Issue Analytics
- State:
- Created 4 years ago
- Comments:14 (7 by maintainers)
Top GitHub Comments
I would then strongly advise to use this approach - mentally users think of the word(-part) they have typed and want that to be matched/highlight. E.g the
i
should be highlighted when showingitem
andinsertText
Apologies, I totally missed that this information is of course in the Range of the TextEdit. Apologies for the noise.