diff --git a/lua/lsp.lua b/lua/lsp.lua index 40e3c53..263b15f 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -65,26 +65,40 @@ function LSPRangeFormatFunction() }) end --- Set different settings for different languages' LSP --- use globally installed vue-language-server (instead of mason provided) -vim.lsp.config('vue_ls', { - -- add filetypes for typescript, javascript and vue - filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, - init_options = { - vue = { - -- disable hybrid mode, will thus use ts_ls internally - hybridMode = false, +-- VUE and Typescript as of vue-language-server 3.0.x +-- taken from: +-- https://github.com/neovim/nvim-lspconfig/blob/master/doc/configs.md#vtsls +local vue_language_server_path = '/home/saschal/.config/yarn/global/node_modules' +local vue_plugin = { + name = '@vue/typescript-plugin', + location = vue_language_server_path, + languages = { 'vue' }, + configNamespace = 'typescript', +} +local vtsls_config = { + settings = { + vtsls = { + tsserver = { + globalPlugins = { + vue_plugin, + }, + }, }, }, -}) + filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }, +} +vim.lsp.config('vtsls', vtsls_config) +-- enable this list of lsps local enable_this_lsp = { 'vue_ls', + 'vtsls', 'gopls', 'bashls', 'html', 'lua_ls', + 'jsonls', } for l in pairs(enable_this_lsp) do