refactor: Add a generic provider module
In preperation for coc support
This commit is contained in:
19
lua/symbols-outline/providers/init.lua
Normal file
19
lua/symbols-outline/providers/init.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
local M = {}
|
||||
|
||||
local providers = {
|
||||
'symbols-outline/providers/nvim-lsp',
|
||||
'symbols-outline/providers/markdown'
|
||||
}
|
||||
|
||||
---@param on_symbols function
|
||||
function M.request_symbols(on_symbols)
|
||||
for _, value in ipairs(providers) do
|
||||
local provider = require(value)
|
||||
if provider.should_use_provider(0) then
|
||||
provider.request_symbols(on_symbols)
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return M
|
||||
Reference in New Issue
Block a user