mirror of
https://github.com/pojokcodeid/nvim-lazy.git
synced 2025-06-23 01:08:53 +02:00
add: tidy up the code, more modular
This commit is contained in:
parent
1545d8335d
commit
1f424a1225
10 changed files with 583 additions and 522 deletions
16
lua/user/utils/lsp.lua
Normal file
16
lua/user/utils/lsp.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
local M = {}
|
||||
|
||||
M.list_registered_providers_names = function(filetype)
|
||||
local s = require("null-ls.sources")
|
||||
local available_sources = s.get_available(filetype)
|
||||
local registered = {}
|
||||
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
|
||||
end
|
||||
|
||||
return M
|
Loading…
Add table
Add a link
Reference in a new issue