summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/lsp/null-ls/services.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/lsp/null-ls/services.lua')
-rw-r--r--.config/nvim/lua/lsp/null-ls/services.lua14
1 files changed, 6 insertions, 8 deletions
diff --git a/.config/nvim/lua/lsp/null-ls/services.lua b/.config/nvim/lua/lsp/null-ls/services.lua
index ef9e7d2..6a52520 100644
--- a/.config/nvim/lua/lsp/null-ls/services.lua
+++ b/.config/nvim/lua/lsp/null-ls/services.lua
@@ -46,15 +46,13 @@ function M.find_command(command)
end
function M.list_registered_providers_names(filetype)
- local u = require "null-ls.utils"
- local c = require "null-ls.config"
+ local s = require "null-ls.sources"
+ local available_sources = s.get_available(filetype)
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
+ for _, source in ipairs(available_sources) do
+ for method in pairs(source.methods) do
+ registered[method] = registered[method] or {}
+ table.insert(registered[method], source.name)
end
end
return registered