summaryrefslogtreecommitdiff
path: root/lua/lsp/null-ls.lua
diff options
context:
space:
mode:
authorAbouzar Parvan <[email protected]>2021-07-31 19:59:52 +0430
committerGitHub <[email protected]>2021-07-31 15:29:52 +0000
commitde200da87d22c0a6e6505c3618fa64a53f9bf4c1 (patch)
tree84c6f55ea342cf933242413c7ef3bd9c12fcf246 /lua/lsp/null-ls.lua
parentc1ace3715447448c42837dac4851ddae90c65e56 (diff)
fix eslint_d issue (#1189)
Diffstat (limited to 'lua/lsp/null-ls.lua')
-rw-r--r--lua/lsp/null-ls.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/lua/lsp/null-ls.lua b/lua/lsp/null-ls.lua
index 468d12a6..2098ea9e 100644
--- a/lua/lsp/null-ls.lua
+++ b/lua/lsp/null-ls.lua
@@ -27,10 +27,6 @@ local function is_nodejs_provider(provider)
end
local function is_provider_found(provider)
- -- special case: fallback to "eslint"
- -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/9b8458bd1648e84169a7e8638091ba15c2f20fc0/doc/BUILTINS.md#eslint
- provider._opts.command = provider._opts.command == "eslint_d" and "eslint" or provider._opts.command
-
local retval = { is_local = false, path = nil }
if vim.fn.executable(provider._opts.command) == 1 then
return false, provider._opts.command
@@ -76,6 +72,11 @@ function M.setup(filetype)
-- builtin_diagnoser._opts.args = linter.args or builtin_diagnoser._opts.args
-- builtin_diagnoser._opts.to_stdin = linter.stdin or builtin_diagnoser._opts.to_stdin
table.insert(M.requested_providers, builtin_diagnoser)
+ -- special case: fallback to "eslint"
+ -- https://github.com/jose-elias-alvarez/null-ls.nvim/blob/9b8458bd1648e84169a7e8638091ba15c2f20fc0/doc/BUILTINS.md#eslint
+ if linter.exe == "eslint_d" then
+ table.insert(M.requested_providers, null_ls.builtins.diagnostics.eslint.with { command = "eslint_d" })
+ end
u.lvim_log(string.format("Using linter provider: [%s]", linter.exe))
end