-
-
Notifications
You must be signed in to change notification settings - Fork 416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicate completion response using hybridMode = false #5105
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Hi I think you have both volar and typescript lsp running at the same time when setting the hybrid mode to false. When hybrid mode is disabled, volar will try to create its own instance of tsserver to handle javascript/typescript. Thus if you attach both lsp to a buffer it will have duplicated completion items e.g. My reproduction while setting hybrid mode to false and also attach a typescript lsp. |
Hello, i did indeed have ts-ls configured for js and ts files (cant see it running though). I tried disabling ts-ls but observed similar results. Shouldn't the ts server show up on htop if its running alongside vue-ls? |
tsserver would not show up in any process monitor software, because volar wraps tsserver in its process if set hybrid mode to false. Just like when you running ts-ls, you would not see any process named as tsserver. (ts-ls also a wrapper around tsserver) If you want to use hybridMode=false, usually you want to complete remove any typescript lsp (e.g. ts-ls, vtsls), and attach volar to javascript/typescript buffers. The reason is that the ts/js file in your vue project has to be able to recognize vue files. ( That's basically why v2 uses the new hybrid approach) https://github.com/vuejs/language-tools?tab=readme-ov-file#community-integration Expand the neovim part, This might help you as the fundamentals are all the same. And btw I think whatever lsp client you are using, it should support hybrid mode because after all it's just an option passing to ts-ls. |
And if you can also try to log lsp payloads to see where are the response come from would be helpful. |
Vue - Official extension or vue-tsc version
@vue/[email protected] [email protected]
VSCode version
Vue version
@vue/[email protected]
TypeScript version
[email protected]
System Info
package.json dependencies
No response
Steps to reproduce
Using https://github.com/yegappan/lsp and this config:
The completion response contains multiple duplicates:
What is expected?
Only one instance of each completion.
What is actually happening?
Multiple of the same completion item.
Link to minimal reproduction
No response
Any additional comments?
I've observed in other lsp clients that use hybridMode: true eliminates this issue. vuels + tsls is not supported yet in https://github.com/yegappan/lsp so it is preferred that hybridMode: true would work as intended instead.
The text was updated successfully, but these errors were encountered: