Skip to content

Commit e28ccc1

Browse files
committed
fix: remove duplicate lsp check entries
1 parent ac9a9de commit e28ccc1

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

lua/ninjection/health.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,13 @@ local function validate_lsp_map(lsp_map)
171171
table.insert(valid_lsp_map, { lsp = lsp, is_valid = false, err = "No config found" })
172172
else
173173
local is_exec, exec_err = is_executable(lsp_cfg.cmd)
174-
table.insert(valid_lsp_map, {
175-
lsp = lsp,
176-
is_valid = is_exec,
177-
err = is_exec and nil or exec_err,
178-
})
174+
if not vim.tbl_contains(valid_lsp_map, lsp) then
175+
table.insert(valid_lsp_map, {
176+
lsp = lsp,
177+
is_valid = is_exec,
178+
err = is_exec and nil or exec_err,
179+
})
180+
end
179181
end
180182
end
181183

0 commit comments

Comments
 (0)