Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:408: enable: expected boolean, got number
stack traceback:
[C]: in function 'error'
vim/shared.lua: in function 'validate'
/usr/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:408: in function 'enable'
...e/yossef/.local/share/nvim/lazy/go.nvim/lua/go/inlay.lua:322: in function ''
vim/_editor.lua: in function <vim/_editor.lua:0>
Press ENTER or type command to continue
经销商 ID:Arch 描述:Arch Linux 发布方式:滚动 代号:不适用
NVIM v0.10.0 构建类型:发布 LuaJIT 2.1.1713773202 运行“nvim -V1 -v”以获取更多信息
我有同样的问题..我的修复:在 gopls 的 on_attach 函数中:
on_attach = function(client, bufnr)
if client.supports_method("textDocument/inlayHint") then
vim.lsp.inlay_hint.enable(true, {
assignVariableTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true,
})
end
end,
可能在
vim.lsp.inlay_hint.enable
中参数未正确传递。