add hybrid mode for vue

This commit is contained in:
Lucas Barbieri 2024-04-18 16:41:31 -03:00
parent 8c28dafcb3
commit 081b578a22
2 changed files with 25 additions and 3 deletions

View File

@ -345,7 +345,6 @@ local on_attach = function(_, bufnr)
) )
vim.diagnostic.config({ float = { border = "single" } }) vim.diagnostic.config({ float = { border = "single" } })
end end
local servers = { local servers = {
-- clangd = {}, -- clangd = {},
-- hls = {}, -- hls = {},
@ -358,7 +357,7 @@ local servers = {
html = { provideFormatter = false }, html = { provideFormatter = false },
cssls = {}, cssls = {},
pyright = {}, pyright = {},
tsserver = {}, vtsls = {},
jdtls = { jdtls = {
java = { java = {
@ -409,10 +408,27 @@ mason_lspconfig.setup_handlers {
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
local mason_registry = require('mason-registry')
local vue_language_server_path = mason_registry.get_package('vue-language-server'):get_install_path() ..
'/node_modules/@vue/language-server'
lspconfig.tsserver.setup {
init_options = {
plugins = {
{
name = '@vue/typescript-plugin',
location = vue_language_server_path,
languages = { 'vue' },
},
},
},
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
}
lspconfig.volar.setup { lspconfig.volar.setup {
init_options = { init_options = {
vue = { vue = {
hybridMode = false, hybridMode = true,
}, },
}, },
} }

View File

@ -0,0 +1,6 @@
return {
"yorickpeterse/nvim-tree-pairs",
config = function()
require('tree-pairs').setup()
end
}