mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-28 03:30:12 +02:00
fix(lsp): fix ts/deno both attaching
This commit is contained in:
parent
fba06ce9f5
commit
f6bcf6f12c
2 changed files with 7 additions and 2 deletions
|
@ -247,9 +247,9 @@ return {
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if LazyVim.lsp.get_config("denols") and LazyVim.lsp.get_config("tsserver") then
|
if LazyVim.lsp.is_enabled("denols") and LazyVim.lsp.is_enabled("vtsls") then
|
||||||
local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
|
local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
|
||||||
LazyVim.lsp.disable("tsserver", is_deno)
|
LazyVim.lsp.disable("vtsls", is_deno)
|
||||||
LazyVim.lsp.disable("denols", function(root_dir)
|
LazyVim.lsp.disable("denols", function(root_dir)
|
||||||
return not is_deno(root_dir)
|
return not is_deno(root_dir)
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -179,6 +179,11 @@ function M.get_config(server)
|
||||||
return rawget(configs, server)
|
return rawget(configs, server)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function M.is_enabled(server)
|
||||||
|
local c = M.get_config(server)
|
||||||
|
return c and c.enabled ~= false
|
||||||
|
end
|
||||||
|
|
||||||
---@param server string
|
---@param server string
|
||||||
---@param cond fun( root_dir, config): boolean
|
---@param cond fun( root_dir, config): boolean
|
||||||
function M.disable(server, cond)
|
function M.disable(server, cond)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue