Skip to content
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

/usr/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:375: enable: expected boolean, got table #454

Closed
diegoroccia opened this issue Apr 26, 2024 · 5 comments

Comments

@diegoroccia
Copy link

My current configuration:
I am running on neovim 0.10-dev, with go.nvim updated to the current master, which includes the fix provided in #452

  {
    "ray-x/go.nvim",
    dependencies = { -- optional packages
      "ray-x/guihua.lua",
      "neovim/nvim-lspconfig",
    },
    ft = { "go", "gomod" },
    build = " :lua require(\"go.install\").update_all_sync()",
    opts = {
      lsp_cfg = false,
    },
  }

and the lsp configuration is as follow

local M = require("go.lsp").config() -- config() return the go.nvim gopls setup

vim.tbl_deep_extend("force", M, {
  gopls = {
    analyses = {
      shadow = true,
      nilness = true,
      unusedparams = true,
      unusedwrite = true,
      useany = true,
    },
    experimentalPostfixCompletions = true,
    gofumpt = true,
    staticcheck = true,
    usePlaceholders = true,
    hints = {
      assignVariableTypes = true,
      compositeLiteralFields = true,
      compositeLiteralTypes = true,
      constantValues = true,
      functionTypeParameters = true,
      parameterNames = true,
      rangeVariableTypes = true,
    },
  },
})

return M

after the latest neovim updates, when I open a go file, I get the following error

Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:375: enable: expected boolean, got table
stack traceback:
	[C]: in function 'error'
	vim/shared.lua: in function 'validate'
	/usr/share/nvim/runtime/lua/vim/lsp/inlay_hint.lua:375: in function 'enable'
	...goroccia/.local/share/nvim/lazy/go.nvim/lua/go/inlay.lua:322: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

everything else lsp related still works

@ray-x
Copy link
Owner

ray-x commented Apr 27, 2024

Both Neovim and go.nvim will need to be updated to the latest master.
There was a breaking change from Neovim regarding inlay-hint

@diegoroccia
Copy link
Author

diegoroccia commented Apr 27, 2024

I have NeoVim v0.10.0-dev-3021+g0547347e7 built from source

NVIM v0.10.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.1703358377

and just updated go.nvim, but I am still getting the same error

@diegoroccia
Copy link
Author

apologies, I tried with another configuration and the hints work, so it must be something wrong with my configuration. I'll investigate it further

@rodhash
Copy link

rodhash commented Apr 27, 2024

Hi

Any chance we can fix or workaround this situation without upgrading to the latest nvim nightly?

I'm having the same issue and I'm running version NVIM v0.10.0-dev-a84b454 .. while upgrading to the newest nvim nightly fix this issue it also seems to introduce a more annoying issue, it doesn't display the "horiz" line from the "fillchars" so whenever I split my screen (and I do that quite often) things get too weird.. you know, a file split but without any line between them ..

Right now I'm locking my plugin to the previous version which seems to run okay right now.. but was wondering if any fix is coming in the next versions..

  {
    "ray-x/go.nvim",
    tag = "v0.2.0",
    ...

Thanks in advance

@diegoroccia
Copy link
Author

@rodhash I suggest to open a new issue, this one is closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants