why is eslint_d so bad (#1192)

This commit is contained in:
Abouzar Parvan 2021-07-31 20:26:25 +04:30 committed by GitHub
parent c4bff33745
commit 2badb25f36
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 4AEE18F83AFDEB23

View file

@ -10,7 +10,13 @@ function M.get_registered_providers_by_filetype(ft)
local matches = {} local matches = {}
for _, provider in pairs(M.requested_providers) do for _, provider in pairs(M.requested_providers) do
if vim.tbl_contains(provider.filetypes, ft) then 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
end end
@ -19,7 +25,7 @@ end
local function is_nodejs_provider(provider) local function is_nodejs_provider(provider)
for _, local_provider in ipairs(nodejs_local_providers) do for _, local_provider in ipairs(nodejs_local_providers) do
if local_provider == provider.exe then if local_provider == provider._opts.command then
return true return true
end end
end end
@ -46,7 +52,7 @@ end
local function validate_provider(provider) local function validate_provider(provider)
local is_local, provider_path = is_provider_found(provider) local is_local, provider_path = is_provider_found(provider)
if not provider_path then 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 return false
end end
if is_local then if is_local then