Closed emilnymann closed 3 months ago
this has been merged right? .. not sure why but I'm still getting this error.. I think commit f119045
is the one related to this, right? I'm currently using latest versions:
nvim v0.11.0-dev-158+g05435a915
noice 69c6ad5
@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 SELECT * FROM
I get the following error:
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
error("Unknown markup " .. vim.inspect(content))
but I am not sure what the correct course of action is here.
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 sqls
but of course I didn't check with other LSP implementations for SQL.
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