2024-05-13 03:10:32 +07:00
|
|
|
return {
|
2024-05-18 14:39:20 +02:00
|
|
|
recommended = function()
|
|
|
|
return LazyVim.extras.wants({
|
|
|
|
ft = "vue",
|
|
|
|
root = { "vue.config.js" },
|
|
|
|
})
|
|
|
|
end,
|
|
|
|
|
2024-06-01 08:31:10 +02:00
|
|
|
-- depends on the typescript extra
|
|
|
|
{ import = "lazyvim.plugins.extras.lang.typescript" },
|
|
|
|
|
2024-05-13 03:10:32 +07:00
|
|
|
{
|
|
|
|
"nvim-treesitter/nvim-treesitter",
|
2024-06-07 09:03:59 +02:00
|
|
|
opts = { ensure_installed = { "vue" } },
|
2024-05-13 03:10:32 +07:00
|
|
|
},
|
|
|
|
|
2024-06-01 08:31:10 +02:00
|
|
|
-- Add LSP servers
|
2024-05-13 03:10:32 +07:00
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
2024-06-01 08:31:10 +02:00
|
|
|
opts = {
|
|
|
|
servers = {
|
2024-06-15 05:06:53 +08:00
|
|
|
volar = {
|
|
|
|
init_options = {
|
|
|
|
vue = {
|
|
|
|
hybridMode = false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2024-06-01 08:31:10 +02:00
|
|
|
vtsls = {},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
-- Configure tsserver plugin
|
|
|
|
{
|
|
|
|
"neovim/nvim-lspconfig",
|
|
|
|
opts = function(_, opts)
|
|
|
|
table.insert(opts.servers.vtsls.filetypes, "vue")
|
2024-05-31 20:53:44 +02:00
|
|
|
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
2024-06-01 08:31:10 +02:00
|
|
|
{
|
|
|
|
name = "@vue/typescript-plugin",
|
|
|
|
location = LazyVim.get_pkg_path("vue-language-server", "/node_modules/@vue/language-server"),
|
|
|
|
languages = { "vue" },
|
|
|
|
configNamespace = "typescript",
|
|
|
|
enableForWorkspaceTypeScriptVersions = true,
|
|
|
|
},
|
2024-05-31 13:52:41 +02:00
|
|
|
})
|
2024-05-13 03:10:32 +07:00
|
|
|
end,
|
|
|
|
},
|
|
|
|
}
|