mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
fix(lsp): format_item should return string (#36025)
Problem: format_item return two value Solution: `:h vim.ui.select()` say format_item should return string
This commit is contained in:
@@ -107,8 +107,10 @@ RSC['window/showMessageRequest'] = function(_, params, ctx)
|
|||||||
local opts = {
|
local opts = {
|
||||||
kind = 'lsp_message',
|
kind = 'lsp_message',
|
||||||
prompt = params.message .. ': ',
|
prompt = params.message .. ': ',
|
||||||
|
---@param action lsp.MessageActionItem
|
||||||
|
---@return string
|
||||||
format_item = function(action)
|
format_item = function(action)
|
||||||
return (action.title:gsub('\r\n', '\\r\\n')):gsub('\n', '\\n')
|
return (action.title:gsub('\r\n', '\\r\\n'):gsub('\n', '\\n'))
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
vim.ui.select(params.actions, opts, function(choice)
|
vim.ui.select(params.actions, opts, function(choice)
|
||||||
|
Reference in New Issue
Block a user