From de200da87d22c0a6e6505c3618fa64a53f9bf4c1 Mon Sep 17 00:00:00 2001 From: Abouzar Parvan Date: Sat, 31 Jul 2021 19:59:52 +0430 Subject: fix eslint_d issue (#1189) --- lua/lsp/null-ls.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lua/lsp') 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 -- cgit v1.2.3