summaryrefslogtreecommitdiff
path: root/lua/lsp/null-ls/services.lua
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-10-09 22:17:30 +0200
committerkylo252 <[email protected]>2021-10-09 22:17:30 +0200
commitcaf62bcfed4fc6cfed26164e39d22a568d21f9d0 (patch)
tree47f7ddcbe7ef10b6cffd8398dbfc215d94fc2fae /lua/lsp/null-ls/services.lua
parent4126e5765d69840660fab2a05bbc664ad0117b95 (diff)
parent82b7a35858479223c1e34bea2f64451ecf1e5f66 (diff)
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'lua/lsp/null-ls/services.lua')
-rw-r--r--lua/lsp/null-ls/services.lua20
1 files changed, 18 insertions, 2 deletions
diff --git a/lua/lsp/null-ls/services.lua b/lua/lsp/null-ls/services.lua
index a1e3a06c..ef9e7d22 100644
--- a/lua/lsp/null-ls/services.lua
+++ b/lua/lsp/null-ls/services.lua
@@ -4,8 +4,8 @@ local function find_root_dir()
local util = require "lspconfig/util"
local lsp_utils = require "lsp.utils"
- local status_ok, ts_client = lsp_utils.is_client_active "typescript"
- if status_ok then
+ local ts_client = lsp_utils.is_client_active "typescript"
+ if ts_client then
return ts_client.config.root_dir
end
local dirname = vim.fn.expand "%:p:h"
@@ -28,6 +28,7 @@ local local_providers = {
prettier_d_slim = { find = from_node_modules },
eslint_d = { find = from_node_modules },
eslint = { find = from_node_modules },
+ stylelint = { find = from_node_modules },
}
function M.find_command(command)
@@ -44,4 +45,19 @@ function M.find_command(command)
return nil
end
+function M.list_registered_providers_names(filetype)
+ local u = require "null-ls.utils"
+ local c = require "null-ls.config"
+ local registered = {}
+ for method, source in pairs(c.get()._methods) do
+ for name, filetypes in pairs(source) do
+ if u.filetype_matches(filetypes, filetype) then
+ registered[method] = registered[method] or {}
+ table.insert(registered[method], name)
+ end
+ end
+ end
+ return registered
+end
+
return M