Inconsistent filterText and textEdit are returned, violating the LSP spec
See original GitHub issueCompleting the following line:
java.util.concurrent.atomic.
In this case the server returns:
[Trace - 08:10:19 AM] Received response 'textDocument/completion - (166)' in 37ms.
Result: {
"items": [
{
"data": {
"uri": "file:///home/kyoncho/Sources/lsp/dap-mode/features/fixtures/test-project/src/main/java/temp/App.java",
"rid": "20",
"pid": "0",
"decl_signature": "Ljava.util.concurrent.atomic.AtomicBoolean;"
},
"textEdit": {
"newText": "java.util.concurrent.atomic.AtomicBoolean",
"range": {
"end": {
"character": 36,
"line": 9
},
"start": {
"character": 8,
"line": 9
}
}
},
"insertTextFormat": 2,
"insertText": "AtomicBoolean",
"filterText": "AtomicBoolean",
"sortText": "999999180",
"detail": "java.util.concurrent.atomic.AtomicBoolean",
"kind": 7,
"label": "AtomicBoolean - java.util.concurrent.atomic"
},
....
As per spec the clients are supposed to use the textEdit range to find out where the completion has started and then filter it against filterText. In this case, the completion of prefix is calculated as java.util.concurrent.atomic. while the filter text is AtomicBoolean.
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (11 by maintainers)
Top Results From Across the Web
Language Server Protocol Specification - 3.14
A request that got canceled still needs to return from the server and send a response back. It can not be left open...
Read more >The Liskov Substitution Principle Explained - Reflectoring
If substituting a superclass object with a subclass object changes the program behavior in unexpected ways, the LSP is violated.
Read more >Diff - vscode-go - Google Git
+ +If you see an "inconsistent vendoring" error, please report it at ... + break; + default: + // Go function can return...
Read more >NorthStar Planner Desktop Application User Guide
A (non-spec) file: Launches the Text Editor where you may edit the file. ... string in the Filter text box and pressing <Enter>...
Read more >Bug List - Bugs - Eclipse
HEAD) returns null even if the repository has a HEAD, 2021-12-27 ... Trailing colon in filter text dropped when state is loaded from...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

That is because JDT LS returns incorrect text range in
Case 2- the clients useCompletion.textEdit.rangeto calculate what to filter against.That’s correct - the range serves as the range that is replaced upon insertion and selects the prefix that’s used for filtering and sorting.