CompletionItem of completions response always have `start = 0` and text prefix inclusion is mixed
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Comienza rastreando el manejo de completions del servidor de depuración de Java para la solicitud completions y la respuesta CompletionItem, utilizando los ejemplos de JDK 21 del informe. Reproduce los casos List. y com. con un cliente como nvim-dap y, después, verifica que start y text sigan la especificación DAP y que seleccionar cada candidato inserte la completación esperada sin duplicar su prefijo.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
I noticed recently that in nvim-dap, if you complete com. and select an entry you get com.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 a completions payload like:
{
frameId = <frameId>,
text = "List.",
column = 6
}
The responses include:
}, {
label = "of(E e1, E e2, E e3, E e4) : List<E>",
number = 0,
sortText = "999999179",
start = 0,
text = "of()",
type = "function"
}, {
The specification says:
/**
- Start position (within the
textattribute of thecompletionsrequest)- where the completion text is added. The position is measured in UTF-16 code
- units and the client capability
columnsStartAt1determines whether it is- 0- or 1-based. If the start position is omitted the text is added at the
- location specified by the
columnattribute of thecompletionsrequest.
*/
start?: number;
The expected result for the user is to have List.of() if the completion candidate is selected. Now, start=0 is already odd given the columnsStartAt1, 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:
{
column = 5,
frameId = <frameId>,
text = "com."
}
I get responses like:
}, {
label = "com.sun.tools.example",
number = 0,
sortText = "999999183",
start = 0,
text = "com.sun.tools.example",
type = "module"
}, {
Opposed to the List. result, here text includes the prefix com. and it's again start=0. This led to com.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
- Lenguaje dominante
- Java
- Estrellas
- 409
- Forks
- 204
- Merge medio
- 1 d 13 h
- PR fusionados (30 d)
- 4
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/java-debug
-
ai-triaged bug
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/java-debug#611 · 2 comentarios ·
-
ai-triaged enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/java-debug#608 · 3 comentarios ·
-
ai-triaged question
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
microsoft/java-debug#597 · 1 comentario ·
-
ai-triaged bug
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
microsoft/java-debug#588 · 1 comentario ·
-
Is Hamcrest a dependency? Abiertoai-triaged question
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
microsoft/java-debug#582 · 1 comentario ·
Todos los issues de microsoft/java-debug
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
elastic/gradle-plugins#157 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
cryptomator/hub#497 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
johanhaleby/occurrent#1120 ·