vim-lsp-settings icon indicating copy to clipboard operation
vim-lsp-settings copied to clipboard

Disable specific server for specific filetype

Open dubst3pp4 opened this issue 2 years ago • 3 comments

Hello, I'm using vim-lsp + vim-lsp-settings to edit Vue files. I've instructed vim-lsp-settings to just use vls as LSP provider in my .vimrc:

let g:lsp_settings_filetype_vue = 'vls'

In *.vue files with TypeScript vim-lsp nevertheless uses both, vls and typescript-language-server. If I run :LspSettingsStatus, I get the following:

vls: running

If I run :LspStatus I get:

vls: running
typescript-language-server: running

What is starting typescript-language-server and how can I disable it just for *.vue files (but not for *.ts files)?

dubst3pp4 avatar Jun 14 '22 12:06 dubst3pp4

:LspSettingsEditLocal on your project root.

{
    "typescript-language-server": {
        "enabled": false
    }
}

mattn avatar Jun 14 '22 13:06 mattn

But does typescript-language-server then still works for TypeScript files in the same project?

dubst3pp4 avatar Jun 14 '22 14:06 dubst3pp4

Sorry for not reporting back. @mattn your solution disables typescript-language-server for the whole project. I want to disable it just for vue files. Both language servers, vls and typescript-language-server are running at the moment for Vue files.

When I put

let g:lsp_settings_filetype_vue = ['vls']

into my .vim/after/ftplugin/vue.vim, unfortunately nothing changes.

One issue that I recognized is, that when I open the vue file directly, eg. with vim path/to/component.vue, the typescript-language-server is disabled, but when I start vim without a file and open the file from within vim, eg. with :e path/to/component.vue the typescript-language-server is started.

I'm using the combination of vim-lsp, vim-lsp-settings and vim-lsp-ale, so I don't know who is causing the troubles.

Thanks for any help! :-)

dubst3pp4 avatar Mar 23 '23 08:03 dubst3pp4