fannheyward / coc-rust-analyzer

rust-analyzer extension for coc.nvim
MIT License
1.13k stars 40 forks source link

Inlay Hints & Types not working #1056

Closed eureka-cpu closed 2 years ago

eureka-cpu commented 2 years ago

What's the output of :CocInfo

## versions

vim version: VIM - Vi IMproved 9.2 8024919
node version: v19.9.0
coc.nvim version: 1.0.82-a315ad6c 2022-09-24 00:13:50 +0800
coc.nvim directory: /home/chrisobrien/.vim/plugged/coc.nvim
term: dumb
platform: linux

## Log of coc.nvim

2023-09-23T17:11:20.981 INFO (pid:66615) [services] - registered service "rust-analyzer"
2023-09-23T17:11:20.983 INFO (pid:66615) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting
2023-09-23T17:11:20.985 INFO (pid:66615) [plugin] - coc.nvim initialized with node: v18.9.0 after 79ms
2023-09-23T17:11:20.993 INFO (pid:66615) [language-client-index] - Language server "rust-analyzer" started with 66628
2023-09-23T17:11:21.005 INFO (pid:66615) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running
2023-09-23T17:11:21.034 INFO (pid:66615) [services] - service rust-analyzer started
2023-09-23T17:11:24.869 INFO (pid:66615) [attach] - receive notification: showInfo []

What's the output of :CocCommand rust-analyzer.serverVersion [coc.nvim] rust-analyzer 0.3.1212-standalone

eureka-cpu commented 2 years ago

This is my first time attempting to use this, it's likely I'm to blame and could use some help

fannheyward commented 2 years ago

Can't reproduce, do you have any settings in your coc-settings.json?

eureka-cpu commented 2 years ago

Here's my settings from that file, I've added them even though some of them are active by default because I was not seeing them appear:

{
  "rust-analyzer.enable": true,
  "rust-analyzer.inlayHints.enable": true,
  "rust-analyzer.inlayHints.typeHints.enable": true,
  "rust-analyzer.inlayHints.parameterHints.enable": true,
  "rust-analyzer.inlayHints.chainingHints.enable": true,
  "rust-analyzer.inlayHints.closingBraceHints.enable": true,
  "rust-analyzer.inlayHints.closureReturnTypeHints.enable": "always"
}  
fannheyward commented 2 years ago

What's your coc-rust-analyzer version? You can get it from :CocList extensions.

eureka-cpu commented 2 years ago

0.68.2

fannheyward commented 2 years ago

You're using vim 8.2, inlayHint feature needs neovim >= 0.5.0 or vim >= 9.0.0067.

eureka-cpu commented 2 years ago

After installing from source, it works, thanks!