mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-12-25 12:14:19 +01:00
fix(lsp): properly ambiguate denols vs vtsls
This commit is contained in:
@@ -230,20 +230,24 @@ return {
|
||||
|
||||
if vim.lsp.is_enabled("denols") and vim.lsp.is_enabled("vtsls") then
|
||||
---@param server string
|
||||
---@param markers string[]
|
||||
local resolve = function(server, markers)
|
||||
local resolve = function(server)
|
||||
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
|
||||
vim.lsp.config(server, {
|
||||
root_dir = function(bufnr, on_dir)
|
||||
local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil
|
||||
if is_deno == (server == "denols") then
|
||||
local root = vim.fs.root(bufnr, markers)
|
||||
return root and on_dir(root)
|
||||
if root_dir then
|
||||
return root_dir(bufnr, on_dir)
|
||||
elseif type(markers) == "table" then
|
||||
local root = vim.fs.root(bufnr, markers)
|
||||
return root and on_dir(root)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
resolve("denols", vim.lsp.config.denols.root_markers)
|
||||
resolve("vtsls", vim.lsp.config.vtsls.root_markers)
|
||||
resolve("denols")
|
||||
resolve("vtsls")
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user