Skip to content

Commit 7b533f3

Browse files
chore(build): auto-generate docs
1 parent ea9fb5f commit 7b533f3

2 files changed

Lines changed: 44 additions & 22 deletions

File tree

docs/extras/lang/typescript.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,28 @@ opts = {
142142
return true
143143
end,
144144
vtsls = function(_, opts)
145+
if vim.lsp.config.denols and vim.lsp.config.vtsls then
146+
---@param server string
147+
local resolve = function(server)
148+
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
149+
vim.lsp.config(server, {
150+
root_dir = function(bufnr, on_dir)
151+
local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil
152+
if is_deno == (server == "denols") then
153+
if root_dir then
154+
return root_dir(bufnr, on_dir)
155+
elseif type(markers) == "table" then
156+
local root = vim.fs.root(bufnr, markers)
157+
return root and on_dir(root)
158+
end
159+
end
160+
end,
161+
})
162+
end
163+
resolve("denols")
164+
resolve("vtsls")
165+
end
166+
145167
LazyVim.lsp.on_attach(function(client, buffer)
146168
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
147169
---@type string, string, lsp.Range
@@ -323,6 +345,28 @@ opts = {
323345
return true
324346
end,
325347
vtsls = function(_, opts)
348+
if vim.lsp.config.denols and vim.lsp.config.vtsls then
349+
---@param server string
350+
local resolve = function(server)
351+
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
352+
vim.lsp.config(server, {
353+
root_dir = function(bufnr, on_dir)
354+
local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil
355+
if is_deno == (server == "denols") then
356+
if root_dir then
357+
return root_dir(bufnr, on_dir)
358+
elseif type(markers) == "table" then
359+
local root = vim.fs.root(bufnr, markers)
360+
return root and on_dir(root)
361+
end
362+
end
363+
end,
364+
})
365+
end
366+
resolve("denols")
367+
resolve("vtsls")
368+
end
369+
326370
LazyVim.lsp.on_attach(function(client, buffer)
327371
client.commands["_typescript.moveToFileRefactoring"] = function(command, ctx)
328372
---@type string, string, lsp.Range

docs/plugins/lsp.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -389,28 +389,6 @@ end
389389
},
390390
})
391391
end
392-
393-
if vim.lsp.is_enabled and vim.lsp.is_enabled("denols") and vim.lsp.is_enabled("vtsls") then
394-
---@param server string
395-
local resolve = function(server)
396-
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
397-
vim.lsp.config(server, {
398-
root_dir = function(bufnr, on_dir)
399-
local is_deno = vim.fs.root(bufnr, { "deno.json", "deno.jsonc" }) ~= nil
400-
if is_deno == (server == "denols") then
401-
if root_dir then
402-
return root_dir(bufnr, on_dir)
403-
elseif type(markers) == "table" then
404-
local root = vim.fs.root(bufnr, markers)
405-
return root and on_dir(root)
406-
end
407-
end
408-
end,
409-
})
410-
end
411-
resolve("denols")
412-
resolve("vtsls")
413-
end
414392
end),
415393
}
416394
```

0 commit comments

Comments
 (0)