mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-25 14:01:06 +00:00
feat: updated v3
This commit is contained in:
parent
024996107b
commit
89db031726
2 changed files with 55 additions and 33 deletions
|
|
@ -62,11 +62,11 @@ return {
|
|||
includePackageJsonAutoImports = "auto",
|
||||
},
|
||||
inlayHints = {
|
||||
enumMemberValues = { enabled = true },
|
||||
functionLikeReturnTypes = { enabled = true },
|
||||
parameterNames = { enabled = "literals" },
|
||||
parameterTypes = { enabled = true },
|
||||
propertyDeclarationTypes = { enabled = true },
|
||||
enumMemberValues = { enabled = false }, -- Disabled for Vue
|
||||
functionLikeReturnTypes = { enabled = false }, -- Disabled for Vue
|
||||
parameterNames = { enabled = "off" }, -- Disabled for Vue
|
||||
parameterTypes = { enabled = false }, -- Disabled for Vue
|
||||
propertyDeclarationTypes = { enabled = false }, -- Disabled for Vue
|
||||
variableTypes = { enabled = false },
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,14 +19,22 @@ return {
|
|||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
volar = {
|
||||
filetypes = { "typescript", "javascript", "javascriptreact", "typescriptreact", "vue" },
|
||||
-- Remove the old volar configuration entirely
|
||||
volar = false, -- This disables the old volar setup
|
||||
|
||||
-- Updated VTSLS configuration for vue-language-tools
|
||||
vtsls = {
|
||||
init_options = {
|
||||
vue = {
|
||||
hybridMode = true,
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = vim.fn.expand("$MASON/packages/vue-language-server/node_modules/@vue/language-server"),
|
||||
languages = { "vue" },
|
||||
configNamespace = "typescript",
|
||||
},
|
||||
},
|
||||
typescript = {
|
||||
tsdk = vim.fn.getcwd() .. "/node_modules/typescript/lib",
|
||||
-- Keep your existing TypeScript settings if needed
|
||||
inlayHints = {
|
||||
enumMemberValues = { enabled = false },
|
||||
functionLikeReturnTypes = { enabled = false },
|
||||
|
|
@ -37,6 +45,43 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"vue",
|
||||
},
|
||||
},
|
||||
|
||||
-- New vue_ls configuration
|
||||
vue_ls = {
|
||||
on_init = function(client)
|
||||
client.handlers["tsserver/request"] = function(_, result, context)
|
||||
local clients = vim.lsp.get_clients({ bufnr = context.bufnr, name = "vtsls" })
|
||||
if #clients == 0 then
|
||||
vim.notify(
|
||||
"Could not found `vtsls` lsp client, vue_lsp would not work without it.",
|
||||
vim.log.levels.ERROR
|
||||
)
|
||||
return
|
||||
end
|
||||
local ts_client = clients[1]
|
||||
local param = unpack(result)
|
||||
local id, command, payload = unpack(param)
|
||||
ts_client:exec_cmd({
|
||||
command = "typescript.tsserverRequest",
|
||||
arguments = {
|
||||
command,
|
||||
payload,
|
||||
},
|
||||
}, { bufnr = context.bufnr }, function(_, r)
|
||||
local response_data = { { id, r.body } }
|
||||
---@diagnostic disable-next-line: param-type-mismatch
|
||||
client:notify("tsserver/response", response_data)
|
||||
end)
|
||||
end
|
||||
end,
|
||||
settings = {
|
||||
vue = {
|
||||
updateImportsOnFileMove = { enabled = "always" },
|
||||
|
|
@ -46,32 +91,9 @@ return {
|
|||
},
|
||||
},
|
||||
},
|
||||
vtsls = {
|
||||
init_options = {
|
||||
plugins = {
|
||||
{
|
||||
name = "@vue/typescript-plugin",
|
||||
location = LazyVim.get_pkg_path("vue-language-server", "/node_modules/@vue/language-server"),
|
||||
languages = { "vue" },
|
||||
configNamespace = "typescript",
|
||||
enableForWorkspaceTypeScriptVersions = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
filetypes = {
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"javascript.jsx",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"typescript.tsx",
|
||||
"vue",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Configure tsserver plugin
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue