rework(preview): Ask providers for hover info

Now lsp checks if client supports hover
Addresses #82
This commit is contained in:
simrat39
2021-11-24 21:44:23 -08:00
parent 552b67993e
commit f4f2b5edfb
5 changed files with 251 additions and 207 deletions

View File

@@ -1,34 +1,35 @@
local M = {}
local providers = {
'symbols-outline/providers/nvim-lsp',
'symbols-outline/providers/coc',
'symbols-outline/providers/markdown'
"symbols-outline/providers/nvim-lsp",
"symbols-outline/providers/coc",
"symbols-outline/providers/markdown",
}
local current_provider;
_G._symbols_outline_current_provider = nil
function M.has_provider()
local ret = false;
for _, value in ipairs(providers) do
local provider = require(value)
if provider.should_use_provider(0) then
ret = true;
break
end
end
return ret
local ret = false
for _, value in ipairs(providers) do
local provider = require(value)
if provider.should_use_provider(0) then
ret = true
break
end
end
return ret
end
---@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
for _, value in ipairs(providers) do
local provider = require(value)
if provider.should_use_provider(0) then
_G._symbols_outline_current_provider = provider
provider.request_symbols(on_symbols)
break
end
end
end
return M