mirror of
https://github.com/neovim/neovim.git
synced 2025-11-17 15:51:32 +00:00
fix(lsp): show notification with empty hover response (#35014)
This commit is contained in:
committed by
GitHub
parent
2495015455
commit
c3991b8ef4
@@ -7110,4 +7110,31 @@ describe('LSP', function()
|
||||
)
|
||||
end)
|
||||
end)
|
||||
|
||||
describe('vim.lsp.buf.hover()', function()
|
||||
it('handles empty contents', function()
|
||||
exec_lua(create_server_definition)
|
||||
exec_lua(function()
|
||||
local server = _G._create_server({
|
||||
capabilities = {
|
||||
hoverProvider = true,
|
||||
},
|
||||
handlers = {
|
||||
['textDocument/hover'] = function(_, _, callback)
|
||||
local res = {
|
||||
contents = {
|
||||
kind = 'markdown',
|
||||
value = '',
|
||||
},
|
||||
}
|
||||
callback(nil, res)
|
||||
end,
|
||||
},
|
||||
})
|
||||
vim.lsp.start({ name = 'dummy', cmd = server.cmd })
|
||||
end)
|
||||
|
||||
eq('Empty hover response', n.exec_capture('lua vim.lsp.buf.hover()'))
|
||||
end)
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user