mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-23 09:18:51 +02:00
fix(lsp): better way of extending deeply nested lists. Fixes #3398
This commit is contained in:
parent
7782affc90
commit
9f2cc30246
3 changed files with 19 additions and 20 deletions
|
@ -119,12 +119,6 @@ return {
|
||||||
-- copy typescript settings to javascript
|
-- copy typescript settings to javascript
|
||||||
opts.settings.javascript =
|
opts.settings.javascript =
|
||||||
vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {})
|
vim.tbl_deep_extend("force", {}, opts.settings.typescript, opts.settings.javascript or {})
|
||||||
local plugins = vim.tbl_get(opts.settings, "vtsls", "tsserver", "globalPlugins")
|
|
||||||
-- allow plugins to have a key for proper merging
|
|
||||||
-- remove the key here
|
|
||||||
if plugins then
|
|
||||||
opts.settings.vtsls.tsserver.globalPlugins = vim.tbl_values(plugins)
|
|
||||||
end
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -27,20 +27,6 @@ return {
|
||||||
-- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files.
|
-- Volar 2.0 has discontinued their "take over mode" which in previous version provided support for typescript in vue files.
|
||||||
-- The new approach to get typescript support involves using the typescript language server along side volar.
|
-- The new approach to get typescript support involves using the typescript language server along side volar.
|
||||||
vtsls = {
|
vtsls = {
|
||||||
settings = {
|
|
||||||
vtsls = {
|
|
||||||
tsserver = {
|
|
||||||
globalPlugins = {
|
|
||||||
-- Use typescript language server along with vue typescript plugin
|
|
||||||
vue = {
|
|
||||||
name = "@vue/typescript-plugin",
|
|
||||||
location = vue_typescript_plugin,
|
|
||||||
languages = { "vue" },
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filetypes = {
|
filetypes = {
|
||||||
"javascript",
|
"javascript",
|
||||||
"javascriptreact",
|
"javascriptreact",
|
||||||
|
@ -52,6 +38,12 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
LazyVim.extend(opts.servers.vtsls, "settings.vtsls.tsserver.globalPlugins", {
|
||||||
|
name = "@vue/typescript-plugin",
|
||||||
|
location = vue_typescript_plugin,
|
||||||
|
languages = { "vue" },
|
||||||
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,6 +72,19 @@ function M.on_very_lazy(fn)
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.extend(t, key, value)
|
||||||
|
local keys = vim.split(key, ".", { plain = true })
|
||||||
|
for i = 1, #keys do
|
||||||
|
local k = keys[i]
|
||||||
|
t[k] = t[k] or {}
|
||||||
|
if type(t) ~= "table" then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
t = t[k]
|
||||||
|
end
|
||||||
|
t[#t + 1] = value
|
||||||
|
end
|
||||||
|
|
||||||
---@param name string
|
---@param name string
|
||||||
function M.opts(name)
|
function M.opts(name)
|
||||||
local plugin = require("lazy.core.config").spec.plugins[name]
|
local plugin = require("lazy.core.config").spec.plugins[name]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue