fix(linter): improve error reporting

This commit is contained in:
2024-07-06 15:20:39 +02:00
parent 0e0ab52947
commit 6d4f4c1330
2 changed files with 15 additions and 7 deletions
+6 -1
View File
@@ -190,7 +190,12 @@ function M:on_attach(client, bufnr)
keymap:init(self, bufnr)
if self.linters then
for _, linter in ipairs(self.linters) do
linter:init(bufnr)
local bin = linter.config.cmd[1]
if utils.is_executable(bin) then
linter:init(bufnr)
else
utils.warn(("Not adding %s because it is not installed"):format(bin))
end
end
end