Skip to content

Commit 4521b6c

Browse files
committed
fix(typescript-all-in-one): update lsp configuration and APIs
1 parent 6129af8 commit 4521b6c

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

  • lua/astrocommunity/pack/typescript-all-in-one

lua/astrocommunity/pack/typescript-all-in-one/init.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ return {
88
config = {
99
denols = {
1010
-- adjust deno ls root directory detection
11-
root_dir = function(...) return require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")(...) end,
11+
root_dir = vim.fs.root(0, { "deno.json", "deno.jsonc" }),
1212
},
1313
},
1414
},
@@ -29,15 +29,13 @@ return {
2929
if curr_client and curr_client.name == "denols" then
3030
local clients = vim.lsp.get_clients { bufnr = bufnr, name = "vtsls" }
3131
for _, client in ipairs(clients) do
32-
vim.lsp.stop_client(client.id, true)
32+
client:stop(true)
3333
end
3434
end
3535

3636
-- if vtsls attached, stop it if there is a denols server attached
3737
if curr_client and curr_client.name == "vtsls" then
38-
if next(vim.lsp.get_clients { bufnr = bufnr, name = "denols" }) then
39-
vim.lsp.stop_client(curr_client.id, true)
40-
end
38+
if next(vim.lsp.get_clients { bufnr = bufnr, name = "denols" }) then curr_client:stop(true) end
4139
end
4240
end,
4341
},

0 commit comments

Comments
 (0)