diff options
| author | Chris <[email protected]> | 2021-07-25 02:49:16 -0400 | 
|---|---|---|
| committer | Chris <[email protected]> | 2021-07-25 02:49:16 -0400 | 
| commit | b694a3ddc2f87e8bbfa63a8f0824061b9ba84469 (patch) | |
| tree | 619f557b8972747187c1d988881ce45e5984c654 /lua/lsp | |
| parent | 425b312799dbcdd399ff70fffcfb7ea4deb01c29 (diff) | |
better logic for null-ls
Diffstat (limited to 'lua/lsp')
| -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 | 
