diff options
Diffstat (limited to 'lua/lsp/null-ls.lua')
-rw-r--r-- | lua/lsp/null-ls.lua | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lua/lsp/null-ls.lua b/lua/lsp/null-ls.lua index 099a6dc1..b425d112 100644 --- a/lua/lsp/null-ls.lua +++ b/lua/lsp/null-ls.lua @@ -34,12 +34,18 @@ local function setup_ls(exe, type) if has_value(local_executables, exe) then local smart_executable = null_ls.builtins[type][exe] local local_executable = find_local_exe(exe) - if vim.fn.executable(local_executable) then + if vim.fn.executable(local_executable) == 1 then smart_executable._opts.command = local_executable + table.insert(sources, smart_executable) + else + if vim.fn.executable(exe) == 1 then + table.insert(sources, smart_executable) + end end - table.insert(sources, smart_executable) else - table.insert(sources, null_ls.builtins[type][exe]) + if vim.fn.executable(exe) == 1 then + table.insert(sources, null_ls.builtins[type][exe]) + end end null_ls.register { sources = sources } end |