Skip to content

Commit de9689b

Browse files
chore(build): auto-generate docs
1 parent 12f5a0a commit de9689b

2 files changed

Lines changed: 14 additions & 36 deletions

File tree

docs/extras/lang/typescript.init.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,6 @@ opts = {
6868
},
6969
},
7070
},
71-
keys = {
72-
{
73-
"<leader>cu",
74-
LazyVim.lsp.action["source.removeUnused.ts"],
75-
desc = "Remove unused imports",
76-
},
77-
{
78-
"<leader>cD",
79-
LazyVim.lsp.action["source.fixAll.ts"],
80-
desc = "Fix all diagnostics",
81-
},
82-
},
8371
},
8472
vtsls = {
8573
-- explicitly add default filetypes, so that we can extend
@@ -149,11 +137,6 @@ opts = {
149137
LazyVim.lsp.action["source.addMissingImports.ts"],
150138
desc = "Add missing imports",
151139
},
152-
{
153-
"<leader>cu",
154-
LazyVim.lsp.action["source.removeUnused.ts"],
155-
desc = "Remove unused imports",
156-
},
157140
{
158141
"<leader>cD",
159142
LazyVim.lsp.action["source.fixAll.ts"],
@@ -281,18 +264,6 @@ opts = {
281264
},
282265
},
283266
},
284-
keys = {
285-
{
286-
"<leader>cu",
287-
LazyVim.lsp.action["source.removeUnused.ts"],
288-
desc = "Remove unused imports",
289-
},
290-
{
291-
"<leader>cD",
292-
LazyVim.lsp.action["source.fixAll.ts"],
293-
desc = "Fix all diagnostics",
294-
},
295-
},
296267
},
297268
vtsls = {
298269
-- explicitly add default filetypes, so that we can extend
@@ -362,11 +333,6 @@ opts = {
362333
LazyVim.lsp.action["source.addMissingImports.ts"],
363334
desc = "Add missing imports",
364335
},
365-
{
366-
"<leader>cu",
367-
LazyVim.lsp.action["source.removeUnused.ts"],
368-
desc = "Remove unused imports",
369-
},
370336
{
371337
"<leader>cD",
372338
LazyVim.lsp.action["source.fixAll.ts"],

docs/plugins/lsp.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,13 @@ opts = function()
192192
"<leader>co",
193193
LazyVim.lsp.action["source.organizeImports"],
194194
desc = "Organize Imports",
195-
code_action = "source.organizeImports",
195+
has = "codeAction",
196+
enabled = function(buf)
197+
local code_actions = vim.tbl_filter(function(action)
198+
return action:find("^source%.organizeImports%.?$")
199+
end, LazyVim.lsp.code_actions({ bufnr = buf }))
200+
return #code_actions > 0
201+
end
196202
},
197203
},
198204
},
@@ -355,7 +361,13 @@ end
355361
"<leader>co",
356362
LazyVim.lsp.action["source.organizeImports"],
357363
desc = "Organize Imports",
358-
code_action = "source.organizeImports",
364+
has = "codeAction",
365+
enabled = function(buf)
366+
local code_actions = vim.tbl_filter(function(action)
367+
return action:find("^source%.organizeImports%.?$")
368+
end, LazyVim.lsp.code_actions({ bufnr = buf }))
369+
return #code_actions > 0
370+
end
359371
},
360372
},
361373
},

0 commit comments

Comments
 (0)