♻️ refactor(nvim): vue-3 is now an extended extra of lazyvim official vue extra
This commit is contained in:
parent
a0c4638365
commit
332e54f6dc
2 changed files with 39 additions and 64 deletions
39
.config/nvim/lua/plugins/extras/lang/web/vue-3-extended.lua
Normal file
39
.config/nvim/lua/plugins/extras/lang/web/vue-3-extended.lua
Normal file
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
{ import = "lazyvim.plugins.extras.lang.vue" },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
volar = {
|
||||
},
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
require("ts-error-translator").translate_diagnostics(err, result, ctx, config)
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmmulroy/ts-error-translator.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "vue-language-server" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vue-3",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
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 = {
|
||||
servers = {
|
||||
volar = {
|
||||
handlers = {
|
||||
["textDocument/publishDiagnostics"] = function(err, result, ctx, config)
|
||||
require("ts-error-translator").translate_diagnostics(err, result, ctx, config)
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(err, result, ctx, config)
|
||||
end,
|
||||
},
|
||||
},
|
||||
tsserver = {},
|
||||
},
|
||||
setup = {
|
||||
tsserver = function(_, opts)
|
||||
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"
|
||||
|
||||
opts.init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = vue_language_server_path,
|
||||
languages = { "vue" },
|
||||
},
|
||||
},
|
||||
}
|
||||
opts.filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" }
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"dmmulroy/ts-error-translator.nvim",
|
||||
opts = {},
|
||||
},
|
||||
{
|
||||
"williamboman/mason.nvim",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "vue-language-server" })
|
||||
end,
|
||||
},
|
||||
{
|
||||
"luckasRanarison/nvim-devdocs",
|
||||
optional = true,
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
"vue-3",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
Loading…
Add table
Reference in a new issue