Search code examples
rustneovimcoc.nvimrust-analyzer

coc-rust-analyzer does not have inlay type hint anymore


My current config

 ➜ cat ~/.config/nvim/coc-settings.json
{
    "suggest.noselect": true,
    "rust-analyzer.inlayHints.typeHints.enable": true,
    "rust-analyzer.inlayHints.chainingHints.enable": true
}

What I am expecting

let a = 12; // there used to be a :i32 displayed next to a

Solution

  • Looks like you're using the stable nvim, and latest coc.nvim supports inline inlayHint https://github.com/neoclide/coc.nvim/pull/4648, that needs nvim 0.10+.

    Yes, this is a breaking change for nvim stable users. Two solutions:

    1. downgrade your coc.nvim to https://github.com/neoclide/coc.nvim/commit/3dc6153a85ed0f185abec1deb972a66af3fbbfb4
    2. upgrade your nvim to 0.10, yes, it's nightly now.