question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

filterText requires trimmed prefixes

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jriekencommented, May 8, 2019

Yes, that seems to be related. I patched gopls to overwrite the “i” instead of appending to it and the completion works as expected.

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 showing item and insertText

0reactions
myitcvcommented, May 15, 2019

Apologies, I totally missed that this information is of course in the Range of the TextEdit. Apologies for the noise.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Text Power Tools - Visual Studio Marketplace
trimFinalNewlines – When true , will trim all new lines after the final new line at the end of the file when saving...
Read more >
java 8 - javafx predicate fires only first time - Stack Overflow
setPredicate(somePredicate); String filterText = externalTradeTableViewDataFilterTextField.getText().trim().toLowerCase(); externalTradesFilteredList.
Read more >
Angular Grid: Text Filter
If true , the input that the user enters will be trimmed when the filter is applied, so any leading or trailing whitespace...
Read more >
Query and filter context | Elasticsearch Guide [8.5] | Elastic
... Stop · Synonym · Synonym graph · Trim · Truncate · Unique · Uppercase · Word delimiter · Word delimiter graph ......
Read more >
Filter Text - Online Text Tools
In this example, we filter text using a text template. ... Quickly trim left or right side of text. Left-pad Text ... Quickly...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found