Closed Trildar closed 6 months ago
Hi, @Trildar
I think this problem is a bug on the language server side. it does not cause problems with VSCode, but seems to cause problems with LSP clients of other editors. The start and end ranges for the selected completion items returned by the language server are probably incorrect. (completionItem/resolve
)
You might want to report the issue to the language server side.
Hi, @Trildar
I think this problem is a bug on the language server side. it does not cause problems with VSCode, but seems to cause problems with LSP clients of other editors. The start and end ranges for the selected completion items returned by the language server are probably incorrect. (
completionItem/resolve
)You might want to report the issue to the language server side.
Yeah, looking at the language server responses, there does seem to be an issue with the ranges returned for completionItem/resolve
, so I filed an issue here: https://github.com/withastro/language-tools/issues/664
But seeing as how Neovim omnifunc apparently also works fine (mentioned in the discussion on LazyVim repo), I have to wonder if it's just a matter of that and VS Code not using ranges from completionItem/resolve
or some bigger issue with how nvim-cmp interacts with the language server.
This issue already solved in latest @astrojs/language-server
FAQ
Announcement
Minimal reproducible full config
Description
Under some circumstances, inserting completions from the Astro LSP inside interpolations in the HTML template result in what looks like the completions being written over incorrect ranges in the buffer.
Steps to reproduce
Initialize an Astro project with
npm create astro@latest
or equivalent. Then try tociw
thetest
inside the{test}
interpolations in a file like the below, typet
, and insert a completion for thetest
variable.Expected behavior
The completion gets inserted and the file is as given in the reproduction example.
Actual behavior
Individually, the cases will become as below. Note that doing the replacement and completions sequentially within the same file may not produce this due to the missing brackets changing the syntax.
Additional context
Another user in the discussion linked below found no issue when using Neovim omnifunc to insert completions in similar circumstances.
Astro framework: https://astro.build/ Some prior discussion of this issue can be found here: https://github.com/LazyVim/LazyVim/discussions/1455