-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: completion item documentation tables with no elements result in "Unknown markup" notification spam #819
Comments
this has been merged right? .. not sure why but I'm still getting this error.. I think commit nvim |
@rodhash when do you get this? Can you give me the steps to reproduce? |
I have the same issue when using nvim-dbee with cmp-dbee. When I start type Error 12:07:35 msg_show.lua_error Error executing vim.schedule lua callback: ...im/nvim-lazyvim/lazy/noice.nvim/lua/noice/lsp/format.lua:35: Unknown markup {
kind = "Markdown",
value = "```\nname: free\ntype: keyword\n```"
}
stack traceback:
[C]: in function 'error'
...im/nvim-lazyvim/lazy/noice.nvim/lua/noice/lsp/format.lua:35: in function 'format_markdown'
.../nvim-lazyvim/lazy/noice.nvim/lua/noice/lsp/override.lua:17: in function 'get_documentation'
...im/nvim-lazyvim/lazy/nvim-cmp/lua/cmp/view/docs_view.lua:48: in function 'open'
...l/share/nvim/nvim-lazyvim/lazy/nvim-cmp/lua/cmp/view.lua:292: in function 'callback'
.../nvim/nvim-lazyvim/lazy/nvim-cmp/lua/cmp/utils/async.lua:138: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Error 12:07:35 msg_show.lua_error Error executing vim.schedule lua callback: ...im/nvim-lazyvim/lazy/noice.nvim/lua/noice/lsp/format.lua:35: Unknown markup {
kind = "Markdown",
value = "```\nname: from\ntype: keyword\n```"
} To investigate, i added print statements before line 35 in format.lua. type(content) -- table
content.kind -- keyword
content.value -- "```\nname: free\ntype: keyword\n```"
content.language -- nil
type(next(content)) -- string We could fix the issue by adding elseif type(content) == "table" and type(next(content)) == "string" then
goto continue or we could just remove Here is my plugin config if you want to reproduce the issue. -- plugins/dbee.lua
return {
'kndndrj/nvim-dbee',
dependencies = {
'MunifTanjim/nui.nvim',
},
build = function()
-- Install tries to automatically detect the install method.
-- if it fails, try calling it with one of these parameters:
-- "curl", "wget", "bitsadmin", "go"
require('dbee').install()
end,
opts = {},
}
-- plugins/dbee-cmp.lua
return {
'hrsh7th/nvim-cmp',
dependencies = {
{
'MattiasMTS/cmp-dbee',
-- commit = '0feabc1',
dependencies = {
{ 'kndndrj/nvim-dbee' },
},
-- ft = 'sql', -- optional but good to have
-- opts = {}, -- needed
config = function()
require('cmp-dbee').setup()
end,
},
},
opts = function(_, opts)
table.insert(opts.sources, { name = 'cmp-dbee' })
end,
} |
@Gabriel2409 what version of noice are you using? #820 was merged and does almost the same thing as your suggestion, and it fixed my instance with |
* up/main: (76 commits) fix(mini): update view options of underlying view. See folke#685 chore(build): auto-generate vimdoc fix(scrollbar): fix scrollbar. Fixes folke#759. Fixes folke#727 chore(main): release 4.2.2 (folke#858) chore(build): auto-generate vimdoc fix(hover): ignore invalid markup. Fixes folke#819 fix(msg): clear existing confirm messages. Fixes folke#302 chore(main): release 4.2.1 (folke#857) chore(build): auto-generate vimdoc fix(cmdline): only use cmdline_input for short prompts without newline. Fixes folke#856 chore(main): release 4.2.0 (folke#850) chore(build): auto-generate vimdoc fix(cmdline): allow overriding title hl fix(cmdline): reset title when needed chore(build): auto-generate vimdoc fix(nui): redo layout when border changes fix(cmdline_input): put in same position as cmdline_popup feat(cmdline): icon for cmdline input fix(fzf): message id feat(cmdline): use cmdline prompt as title. Noice is now great for vim.ui.input out of the box ...
Did you check docs and existing issues?
Neovim version (nvim -v)
0.11.0-dev (nightly from apt PPA)
Operating system/version
Ubuntu 24.04 LTS
Describe the bug
Using a language server that does (apparently) not provide documentation causes an error notification every time the cmp (code completion) changes. The error is thrown in
lua/noice/lsp/format.lua
on line 33, since theformat_markdown
function only handles list-type tables.This is occuring for me in an
.sql
file with thesqls
LSP attached. I've inspecteditem.documentation
fromlua/noice/lsp/override
's setup function, and concluded that it's an empty table. I don't know what's a good way to handle this from your point of view, hence the issue and not a pull request. If you can provide some thoughts on the issue I would be happy to fix it.I also realise this is, at its core, an issue with the LSP not providing said documentation, but I don't think trying to format it every time and throwing an error is the endgame for that kind of case.
Steps To Reproduce
.sql
file buffersqls
LSP (installed with Mason, defaults-configured with lspconfig and mason_lspconfig)CREATE TABLE
and see that the LSP does provide code completion suggestions, but also see a red error notification appear for every letter you type.Expected Behavior
Graceful(?) handling of unprovided documentation data.
Repro
The text was updated successfully, but these errors were encountered: