mrcjkb / rustaceanvim

🦀 Supercharge your Rust experience in Neovim! A heavily modified fork of rust-tools.nvim
GNU General Public License v2.0
1.62k stars 58 forks source link

see :help vim.lsp.inlay_hint.enable() for updated parameters #365

Closed limitLiu closed 5 months ago

limitLiu commented 5 months ago

Have you read the docs and searched existing issues?

Neovim version (nvim -v)

NVIM v0.10.0-dev-2954+g13ebfafc9

Operating system/version

macOS 14.4.1

Output of :checkhealth rustaceanvim

==============================================================================
rustaceanvim: require("rustaceanvim.health").check()

Checking for Lua dependencies ~
- OK [mfussenegger/nvim-dap](https://github.com/mfussenegger/nvim-dap) installed.

Checking external dependencies ~
- OK rust-analyzer: found rust-analyzer 0.3.1924-standalone (5dbe3fe75 2024-04-14)
- OK Cargo: found cargo 1.79.0-nightly (48eca1b16 2024-04-12)
- OK rustc: found rustc 1.79.0-nightly (0d8b3346a 2024-04-14)
- OK debug adapter: found codelldb 

Checking config ~
- OK No errors found in config.

Checking for conflicting plugins ~
- OK No conflicting plugins detected.

Checking for tree-sitter parser ~
- OK tree-sitter parser for Rust detected.

How to reproduce the issue

update to NVIM v0.10.0-dev-2954+g13ebfafc9

Expected behaviour

It should have no error message.

Actual behaviour

"see :help vim.lsp.inlay_hint.enable() for updated parameters"

The following is the code after I fixed it.

  -- server_status.lua file
  if type(vim.lsp.inlay_hint) == 'table' then
    for _, bufnr in ipairs(vim.lsp.get_buffers_by_client_id(ctx.client_id)) do
      if vim.lsp.inlay_hint.is_enabled(bufnr) then
        vim.lsp.inlay_hint.enable(false, { bufnr = bufnr })
        vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
      end
    end
  end

The minimal config used to reproduce this issue.

I just updated to the version released on April 19th, where this issue appeared.
mrcjkb commented 5 months ago

Hey :wave:

Thanks for reporting. For future reference, I have a weekly CI action that updates Neovim nightly to catch breaking API changes. So there's no need to open issues like this (hence the I can reproduce the issue with stable Neovim (not a distribution or nightly) checkbox in the issue template).

dreamerlzl commented 4 months ago

To update the inlay hint conf, can check this:

https://github.com/dreamerlzl/nvim-setup/commit/2d32cfde01ddd1b1773c9815362e76d77792ba96#diff-187664e61cf761a09491263b688a3e4c8fa3af526a505ca5a770db8b78d5db11