refactor(providers): Let get_status() return a list of strings instead
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user