Volar 2 - Two servers, only one for completion #471
-
Hello, I'm far out in deep waters in my assumptions so please correct me if im wrong. The new volar 2 server depends on two lsp's running side by side. One for vue completion <style> and "<template>" and tsserver for <script>. It seems like some have managed to make it work i neovim, i've tried to update my config for this client: {
"name": "ts-ls",
"filetype": ["typescript", "javascript", "vue"],
"path": "typescript-language-server",
"args": ["--stdio"],
"features": {
"documentFormatting": false
},
"initializationOptions": {
"plugins":[
{
"name": "@vue/typescript-plugin",
"location":"home/daniel/.nvm/versions/node/v20.11.0/lib/node_modules/@vue/typescript-plugin",
"languages": ["vue"]
}
]
}
},
{
"name": "vue-ls",
"filetype": ["vue"],
"path": "vue-language-server",
"args": ["--stdio"],
"features": {
"documentFormatting": true
},
"initializationOptions": {
"typescript": {
"tsdk": "/home/daniel/.nvm/versions/node/v20.11.0/lib/node_modules/typescript/lib"
}
},
"workspaceConfig": {
"html": {
"format": {
"wrapAttributes": "force-aligned"
}
}
}
},
The problem i have is that i can either get only vue (html) completions or ts completions. But not both. I read section 16 in the doc, though did not find how to use the same feature from two server. (Maybe i shouldnt?) I should note that there is an discussion ongoing about the correct way of configuring volar: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
Hey Daniel It's been a while since I made the initial PR's that added support for multiple servers. And I havn't followed to closely lately, but when I left it off only supported completions from one LSP-server. I think it's written quite clear in the docs:
I guess we could be more clear about the fact that everything but diagnostics are being used from one LSP-server only. I also think that it would make sense for completions to come from multiple sources. Looking at the source code it stills looks like only one server is used for completion, see lsp/autoload/lsp/completion.vim Line 471 in 0b9bba0 and lsp/autoload/lsp/completion.vim Line 539 in 0b9bba0 and lsp/autoload/lsp/completion.vim Line 565 in 0b9bba0 for 24/7 completion / Andreas |
Beta Was this translation helpful? Give feedback.
-
I've managed to get completion of multiple servers working, so far it seems stable. https://github.com/DanielViberg/lsp |
Beta Was this translation helpful? Give feedback.
-
Currently working on:
|
Beta Was this translation helpful? Give feedback.
#480