refactor: Provider symbol actions

It makes sense to store the provider each sidebar is using with own
self.provider fields, no way that did not occur to me before this.

The old `_G._outline_current_provider` ironically, can now be replaced
by `require('outline').current.provider`.
This commit is contained in:
hedy
2023-11-26 15:14:42 +08:00
parent 1743ee7c66
commit b90174c6c2
8 changed files with 78 additions and 91 deletions

View File

@@ -89,4 +89,20 @@ function M.request_symbols(on_symbols, opts)
end)
end
-- No good way to update outline when LSP action complete for now
---@param sidebar outline.Sidebar
function M.code_actions(sidebar)
sidebar:wrap_goto_location(function()
vim.lsp.buf.code_action()
end)
end
---@param sidebar outline.Sidebar
function M.rename_symbol(sidebar)
sidebar:wrap_goto_location(function()
vim.lsp.buf.rename()
end)
end
return M