-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
CompletionItem of completions response always have start = 0
and text prefix inclusion is mixed
#524
Comments
mfussenegger
added a commit
to mfussenegger/java-debug
that referenced
this issue
Dec 8, 2023
Fixes microsoft#524 Ensures completion text can be appended by clients E.g. For `com.|` the completion proposal has: completion: com.sun.jndi.ldap.pool completionLocation: 3 replaceEnd: 4 replaceStart: 0 `insertText` will be `sun.jndi.ldap.pool` For `List.|` the completion proposal has: completion: of() completionLocation: 4 replaceStart: 5 replaceEnd: 5 `insertText` will be `of()`
mfussenegger
added a commit
to mfussenegger/java-debug
that referenced
this issue
Dec 8, 2023
Fixes microsoft#524 Ensures completion text can be appended by clients E.g. For `com.|` the completion proposal has: completion: com.sun.jndi.ldap.pool completionLocation: 3 replaceEnd: 4 replaceStart: 0 `insertText` will be `sun.jndi.ldap.pool` For `List.|` the completion proposal has: completion: of() completionLocation: 4 replaceStart: 5 replaceEnd: 5 `insertText` will be `of()`
Lines 348 to 358 in 736dcac
|
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I noticed recently that in nvim-dap, if you complete
com.
and select an entry you getcom.com...
inserted, so today I took a closer look and noticed that the responses from java-debug are somewhat odd - and I think incorrect.With a client that specified
columnsStartAt1 = true
, and acompletions
payload like:The responses include:
The specification says:
The expected result for the user is to have
List.of()
if the completion candidate is selected. Now,start=0
is already odd given thecolumnsStartAt1
, so a possible interpretation in the client is that it's absent, and that the client should just append.of()
This is kinda what I did in nvim-dap so far, and it works for the
List.of
case, and also for variables, but with a payload like:I get responses like:
Opposed to the
List.
result, heretext
includes the prefixcom.
and it's againstart=0
. This led tocom.com.sun.tools.example
I suspect vscode does some kind of prefix matching on the client side again, so this isn't noticable there?
As far as I can tell, based on the specification the current behavior is wrong.
I used JDK 21 in my tests - in case it matters.
I can also provide some sample project if needed - but I tried to use examples that should behave similar with only the JDK as dependency
The text was updated successfully, but these errors were encountered: