71 lines
1.8 KiB
Lua
71 lines
1.8 KiB
Lua
return {
|
|
'neovim/nvim-lspconfig',
|
|
dependencies = { 'saghen/blink.cmp' },
|
|
config = function(_,_)
|
|
|
|
local vue_language_server_path = vim.fn.expand '$MASON/packages' .. '/vue-language-server' .. '/node_modules/@vue/language-server'
|
|
|
|
local tsserver_filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' }
|
|
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 = tsserver_filetypes,
|
|
}
|
|
|
|
local ts_ls_config = {
|
|
init_options = {
|
|
plugins = {
|
|
vue_plugin,
|
|
},
|
|
},
|
|
filetypes = tsserver_filetypes,
|
|
}
|
|
|
|
-- If you are on most recent `nvim-lspconfig`
|
|
local vue_ls_config = {}
|
|
-- nvim 0.11 or above
|
|
vim.lsp.config('vtsls', vtsls_config)
|
|
vim.lsp.config('vue_ls', vue_ls_config)
|
|
vim.lsp.config('lua_ls', {})
|
|
-- vim.lsp.config('rust_analyzer', {})
|
|
vim.lsp.enable({'vtsls', 'vue_ls', 'lua_ls'})
|
|
end
|
|
|
|
|
|
-- opts = {
|
|
-- servers = {
|
|
-- lua_ls = {},
|
|
-- nil_ls = {},
|
|
-- vstls = {},
|
|
-- vue_ls = {},
|
|
-- -- rust_analyzer = {},
|
|
-- -- gopls = {},
|
|
-- }
|
|
-- },
|
|
-- config = function(_, opts)
|
|
-- for server, config in pairs(opts.servers) do
|
|
-- config.capabilities = require('blink.cmp').get_lsp_capabilities(config.capabilities)
|
|
--
|
|
-- -- Verwende `vim.lsp.config` um die Konfiguration anzupassen
|
|
-- vim.lsp.config(server, config)
|
|
--
|
|
-- -- Aktiviere die Konfiguration
|
|
-- vim.lsp.enable(server)
|
|
-- end
|
|
-- end
|
|
}
|
|
|