diff options
author | Abouzar Parvan <[email protected]> | 2021-07-31 20:26:25 +0430 |
---|---|---|
committer | GitHub <[email protected]> | 2021-07-31 15:56:25 +0000 |
commit | 2badb25f361ddeae32fcd482384cccdab96f8e68 (patch) | |
tree | 1384f91e88c299f67f0da2bebee6e6465643cdc2 | |
parent | c4bff33745eb765ba49b170db2776284f5d015ef (diff) |
why is eslint_d so bad (#1192)
-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 fde6c5bd..1d9f1ec1 100644 --- a/lua/lsp/null-ls.lua +++ b/lua/lsp/null-ls.lua @@ -10,7 +10,13 @@ function M.get_registered_providers_by_filetype(ft) local matches = {} for _, provider in pairs(M.requested_providers) do if vim.tbl_contains(provider.filetypes, ft) then - table.insert(matches, provider._opts.command) + local provider_name = provider.name + -- special case: show "eslint_d" instead of eslint + -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/9b8458bd1648e84169a7e8638091ba15c2f20fc0/doc/BUILTINS.md#eslint + if string.find(provider._opts.command, "eslint_d") then + provider_name = "eslint_d" + end + table.insert(matches, provider_name) end end @@ -19,7 +25,7 @@ end local function is_nodejs_provider(provider) for _, local_provider in ipairs(nodejs_local_providers) do - if local_provider == provider.exe then + if local_provider == provider._opts.command then return true end end @@ -46,7 +52,7 @@ end local function validate_provider(provider) local is_local, provider_path = is_provider_found(provider) if not provider_path then - u.lvim_log(string.format("Unable to find the path for: [%s]", provider)) + u.lvim_log(string.format("Unable to find the path for: [%s]", vim.inspect(provider))) return false end if is_local then |