lspsaga.nvim
lspsaga.nvim copied to clipboard
"No information available" when calling hover_doc
Describe the bug
Is supposed that using the ++quiet
mode the notification saying "No information available" should disappear, but it doesn't.
I don't know if is only happening to me.
keymap.set("n", "<leader>K", "<cmd>Lspsaga hover_doc ++quiet<CR>", opts) -- show documentation for the cursor
I'm using the last published version.
This is related to #1015.
Screen capture
Steps to reproduce
- Open a react typescript file
- Call
Lspsaga hover_doc ++quiet
over the component name (which is typed properly).
Expected behavior
Do not see any notification or message saying "No information available", just see the hover_doc floating box.
Neovim version (nvim -v)
NVIM v0.9.1 Build type: Release LuaJIT 2.1.0-beta3
lspsaga commit
5fa17a8
Terminal name/version
iTerm2 build 3.4.20
hmm which servers you used on this buffer. and btw kitty better than iterm2 :+1:
@glepnir using tsserver
-> https://github.com/diegoulloao/nvim-diegoulloao/blob/91a5761a0ea83fad24d0951d2ba47d8317d1403a/plugins/lsp/lspconfig.lua#L69
I'll check kitty, thanks for the recommendation.
tailwindcss
and emmet
also attach this buffer right ?
that's correct, sorry I missed those
Lspsaga hover_doc ++silent
Lspsaga hover_doc ++silent
it doesn't work, same issue, actually I already tried ++silent
before
I can't reproduce with ++silent
that's wired
@glepnir
I can reproduce with ++silent
The only things that changed in my configuration was the switch from lsp-zero v2
to lsp-zero v3
.
Actually the only workaround I found was to switch from
Lspsaga hover_doc
To basic neovim lsp hover
vim.lsp.buf.hover()
To avoid being spammed by No information available
notifications.
Even with this configuration of the handlers :
vim.lsp.handlers["textDocument/hover"] = function(_, result, ctx, config)
config = config or {}
config.focus_id = ctx.method
if not (result and result.contents) then
return
end
config.border = "rounded"
local markdown_lines = vim.lsp.util.convert_input_to_markdown_lines(result.contents)
markdown_lines = vim.lsp.util.trim_empty_lines(markdown_lines)
if vim.tbl_isempty(markdown_lines) then
return
end
return vim.lsp.util.open_floating_preview(markdown_lines, "markdown", config)
end
end
I still got the No information available
notifications, only with lspsaga
I can't reproduce and which language servers in which file?
I can't reproduce and which language servers in which file?
@glepnir
List of language servers :
File is a .tsx
Please see.:
Command used :
Lspsaga hover_doc ++silent
I don't have any steps for you to reproduce, all that I can give is my neovim configuration if you want to try it by yourself, you can find it here : ls-devs/nvim
Other thing, I'm not sure I have to post it here since it's another issue, but when requesting a hover
on a tailwind
class, I first have the window opening (still with the notification No information available
indeed). But if I request another hover
I have this notification : [lspsaga] a hover request has already been sent, please wait.
and can't request hover
anymore. The only way for me to have the hover
working again is to quit neovim and restarting it.
I will try it later.
I will try it later.
Thanks.
FYI, you can find the list of keymaps in the file legendary.lua
.
Leader key is <Space>
If you want informations on keybinds, kind of which-key
does, you can use <leader>LK
Actual keybind for Lspsaga hover_doc ++silent
is :
{
"<leader>K",
"<cmd>Lspsaga hover_doc ++silent<CR>",
description = "LSPSaga Hover Doc",
opts = opts,
},
Hi @glepnir
Face this issue today
NVIM v0.9.2 Build type: Release LuaJIT 2.1.1694285958
I tried quite and silent, but nothing helped
But if I request another
hover
I have this notification :[lspsaga] a hover request has already been sent, please wait.
and can't requesthover
anymore. The only way for me to have thehover
working again is to quit neovim and restarting it.
I'm having this same issue, but it arises after trying hover_doc
on something "invalid", like await
, const
, etc in typescript. If I ever try to request documentation on things of that sort, then I have to restart neovim in order to see documentation again.
This doesn't occur in other languages(from what I can tell), and the only lsp I have attached is tsserver
.
@glepnir I think you should reopen this issue.
If you are using noice
with the notify
integration, a temporary fix is:
noice.setup({
-- filters
routes = {
{
-- avoid annoying message
filter = {
event = "notify",
find = "No information available",
},
opts = { skip = true },
},
},
})
For anybody come here from Google, this is my solution from my config:
vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(function(_nil, result, ctx, config)
if result then
return vim.lsp.handlers.hover(_nil, result, ctx, config)
end
end, { border = "rounded" })
This is still happening in nvim 0.10.0
🙁