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
|
if p.get_status then
|
||||||
table.insert(lines, 'Provider info:')
|
table.insert(lines, 'Provider info:')
|
||||||
table.insert(lines, '')
|
table.insert(lines, '')
|
||||||
local l = p.get_status()
|
for _, line in ipairs(p.get_status()) do
|
||||||
for _, line in ipairs(vim.split(l, '\n', { plain = true, trimempty = false })) do
|
|
||||||
table.insert(lines, indent .. line)
|
table.insert(lines, indent .. line)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ local M = {
|
|||||||
|
|
||||||
function M.get_status()
|
function M.get_status()
|
||||||
if not M.client then
|
if not M.client then
|
||||||
return 'No clients'
|
return { 'No clients' }
|
||||||
end
|
end
|
||||||
return 'client: ' .. M.client.name
|
return { 'client: ' .. M.client.name }
|
||||||
end
|
end
|
||||||
|
|
||||||
local function get_params()
|
local function get_params()
|
||||||
|
|||||||
@@ -69,7 +69,7 @@
|
|||||||
---@field hover_info fun(bufnr:integer, params:table, on_info:function)
|
---@field hover_info fun(bufnr:integer, params:table, on_info:function)
|
||||||
---@field request_symbols fun(on_symbols:function, opts:table)
|
---@field request_symbols fun(on_symbols:function, opts:table)
|
||||||
---@field name string
|
---@field name string
|
||||||
---@field get_status? fun():string
|
---@field get_status? fun():string[]
|
||||||
|
|
||||||
-- HELP
|
-- HELP
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user