Skip to content

Commit 312fc76

Browse files
committed
fix: duplicate lsp check entries
1 parent e28ccc1 commit 312fc76

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lua/ninjection/health.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,19 @@ local function validate_lsp_map(lsp_map)
163163
return false, "Unsupported cmd type: " .. type(lsp_cmd)
164164
end
165165

166+
---@type table<string, boolean>
167+
local checked_lsp = {}
168+
166169
---@type string
167170
for _, lsp in pairs(lsp_map) do
171+
if not checked_lsp[lsp] then
172+
checked_lsp[lsp] = true
168173
---@type vim.lsp.ClientConfig?
169174
local lsp_cfg = vim.lsp.config[lsp]
170175
if not lsp_cfg then
171176
table.insert(valid_lsp_map, { lsp = lsp, is_valid = false, err = "No config found" })
172177
else
173178
local is_exec, exec_err = is_executable(lsp_cfg.cmd)
174-
if not vim.tbl_contains(valid_lsp_map, lsp) then
175179
table.insert(valid_lsp_map, {
176180
lsp = lsp,
177181
is_valid = is_exec,

0 commit comments

Comments
 (0)