🏷️ Feature TypeNew languages 🔖 Feature descriptionI saw that there are some changes going on currently with the lsp integration. |
Replies: 10 comments 10 replies
|
For personal use, |
|
I am still fighting with getting it to work, but I saw that the built-in languages didn't use the |
|
hey, have you been able to find a solution for this? ive been struggling as well... |
Yes, I have implemented everything that I needed for vue with nvf. Adding new lsps from lspconfig is pretty easy actually: lsp = {
lspconfig = {
enable = true;
sources = {
vue_ls = ''
vim.lsp.enable('vue_ls')
vim.lsp.config('vue_ls', {})
'';
eslint = ''
vim.lsp.enable('eslint')
vim.lsp.config('eslint', {})
'';
ts_ls = ''
vim.lsp.enable('ts_ls')
vim.lsp.config('ts_ls', {
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = "${pkgs.vue-language-server}/lib/node_modules/@vue/language-server",
languages = {"vue"},
},
},
},
filetypes = {
"javascript",
"typescript",
"vue",
},
})
'';
};
};
};This is my config with eslint. I am not using prettier, but using eslint as formatter as well, so I also disabled prettier in the conform-nvim formatter config in nvf. I am using home manager, so I also added these 3 language servers to the home.packages part of my nvf module: |
|
Thank you so much! |
|
with the new vim.lsp.servers api the following is recommended see options docs for details on vim.lsp.servers |
Is this only referring to the home.packages part? |
|
I'm not really sure what you're talking about with home.packages
i was referring to this part. this is the updated code: vim.lsp.servers = {
vue_ls = {};
};
|
|
Is there a reference for vtsls and vue? I got ts_ls to work with the vue plugin without a problem, but I need to switch to vtsls for performance reasons and vtsls is the only supported ts lsp for vue_lsp from v3 onwards. |
|
https://nvf.notashelf.dev/options.html#option-vim.languages.vue.lsp.servers We got support for "vue-language-server" and "vtsls" for a while now |
https://nvf.notashelf.dev/options.html#option-vim.languages.vue.lsp.servers
We got support for "vue-language-server" and "vtsls" for a while now