fix(providers): Ensure working on nvim-0.7

This commit removed the ability to receive symbols from all attached
clients in the current buffer. Everything works as before when only one
client is attached to a buffer.

This also fixes outline LSP finding clients on nvim-0.7
This commit is contained in:
hedy
2023-12-29 19:17:00 +08:00
parent 5669c8aa9e
commit 8b2f412b7b
7 changed files with 91 additions and 48 deletions

View File

@@ -1,17 +1,19 @@
local M = {}
local import_prefix = 'outline/providers/'
---@return outline.Provider?
---@return outline.Provider?, table?
function M.find_provider()
if not M.providers then
M.providers = vim.tbl_map(function(p)
return import_prefix .. p
end, require('outline.config').get_providers())
end
for _, path in ipairs(M.providers) do
local provider = require(path)
if provider.supports_buffer(0) then
return provider
local ok, info = provider.supports_buffer(0)
if ok then
return provider, info
end
end
end