-
Notifications
You must be signed in to change notification settings - Fork 989
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(vue): add Vue.js support to LazyVim (#3094)
- Loading branch information
1 parent
e89653f
commit f449025
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
return { | ||
{ | ||
"nvim-treesitter/nvim-treesitter", | ||
opts = function(_, opts) | ||
if type(opts.ensure_installed) == "table" then | ||
vim.list_extend(opts.ensure_installed, { "vue" }) | ||
end | ||
end, | ||
}, | ||
|
||
{ | ||
"neovim/nvim-lspconfig", | ||
opts = function(_, opts) | ||
local vue_typescript_plugin = require("mason-registry").get_package("vue-language-server"):get_install_path() | ||
.. "/node_modules/@vue/language-server" | ||
.. "/node_modules/@vue/typescript-plugin" | ||
|
||
opts.servers = vim.tbl_deep_extend("force", opts.servers, { | ||
volar = {}, | ||
-- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files. | ||
-- The new approach to get typescript support involves using the typescript language server along side volar. | ||
tsserver = { | ||
init_options = { | ||
plugins = { | ||
-- Use typescript language server along with vue typescript plugin | ||
{ | ||
name = "@vue/typescript-plugin", | ||
location = vue_typescript_plugin, | ||
languages = { "javascript", "typescript", "vue" }, | ||
}, | ||
}, | ||
}, | ||
filetypes = { | ||
"javascript", | ||
"javascriptreact", | ||
"javascript.jsx", | ||
"typescript", | ||
"typescriptreact", | ||
"typescript.tsx", | ||
"vue", | ||
}, | ||
}, | ||
}) | ||
end, | ||
}, | ||
} |