Skip to content

Commit

Permalink
Fix: Update Mason Handler for Volar
Browse files Browse the repository at this point in the history
  • Loading branch information
GR3YH4TT3R93 committed Mar 23, 2024
1 parent 3c60c6b commit 7bb6858
Showing 1 changed file with 29 additions and 16 deletions.
45 changes: 29 additions & 16 deletions lua/plugins/lsp/mason.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ return {
config = function()
local null_ls = require("null-ls")
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local prefix = os.getenv("PREFIX")
-- local prefix = os.getenv("PREFIX")

require("mason").setup({})
require("mason-update-all").setup({})
Expand Down Expand Up @@ -77,23 +77,36 @@ return {
-- ["rust_analyzer"] = function ()
-- require("rust-tools").setup {}
-- end
["tsserver"] = function()
require("lspconfig").tsserver.setup({
-- ["tsserver"] = function()
-- require("lspconfig").tsserver.setup({
-- init_options = {
-- plugins = {
-- {
-- name = "@vue/typescript-plugin",
-- -- Change this to the location the plugin is installed to this
-- -- is the standard location for npm i -g
-- location = prefix .. "/lib/node_modules/@vue/typescript-plugin",
-- languages = { "javascript", "typescript", "vue" },
-- },
-- },
-- },
-- filetypes = {
-- "javascript",
-- "typescript",
-- "vue",
-- },
-- })
-- end,
["volar"] = function()
require("lspconfig").volar.setup({
filetypes = { "vue", "javascript", "typescript", "typescriptreact", "javascriptreact" },
init_options = {
plugins = {
{
name = "@vue/typescript-plugin",
-- Change this to the location the plugin is installed to this
-- is the standard location for npm i -g
location = prefix .. "/lib/node_modules/@vue/typescript-plugin",
languages = { "javascript", "typescript", "vue" },
},
vue = {
hybridMode = false,
},
typescript = {
tsdk = vim.fn.getcwd() .. "node_modules/typescript/lib",
},
},
filetypes = {
"javascript",
"typescript",
"vue",
},
})
end,
Expand Down

0 comments on commit 7bb6858

Please sign in to comment.