Skip to content

Commit

Permalink
refactor(providers): Let get_status() return a list of strings instead
Browse files Browse the repository at this point in the history
  • Loading branch information
hedyhli committed Nov 19, 2023
1 parent 9b90379 commit 3762402
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lua/outline/docs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ function M.show_status(ctx)
if p.get_status then
table.insert(lines, 'Provider info:')
table.insert(lines, '')
local l = p.get_status()
for _, line in ipairs(vim.split(l, '\n', { plain = true, trimempty = false })) do
for _, line in ipairs(p.get_status()) do
table.insert(lines, indent .. line)
end
end
Expand Down
4 changes: 2 additions & 2 deletions lua/outline/providers/nvim-lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ local M = {

function M.get_status()
if not M.client then
return 'No clients'
return { 'No clients' }
end
return 'client: ' .. M.client.name
return { 'client: ' .. M.client.name }
end

local function get_params()
Expand Down
2 changes: 1 addition & 1 deletion lua/outline/types/outline.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
---@field hover_info fun(bufnr:integer, params:table, on_info:function)
---@field request_symbols fun(on_symbols:function, opts:table)
---@field name string
---@field get_status? fun():string
---@field get_status? fun():string[]

-- HELP

Expand Down

0 comments on commit 3762402

Please sign in to comment.