Skip to content

Commit

Permalink
lsp(vue): add tsserver config for vue projects
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Jul 27, 2024
1 parent 513b72d commit fc47eb2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/nxvim/lsp/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ local function toggle_format_on_save(silent)
callback = function()
vim.lsp.buf.format({
async = false,
filter = function(client) return client.name ~= "zls" and client.name ~= "tsserver" end,
filter = function(client)
for _, name in ipairs({ "zls", "tsserver", "volar" }) do
if name == client.name then return false end
end
return true
end,
})
end,
})
Expand Down
13 changes: 13 additions & 0 deletions lua/nxvim/lsp/settings/tsserver.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
return {
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
location = require("mason-registry").get_package("vue-language-server"):get_install_path()
.. "/node_modules/@vue/language-server",
languages = { "vue" },
},
},
},
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
}

0 comments on commit fc47eb2

Please sign in to comment.