fannheyward / coc-rust-analyzer

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

Type hint is not displayed #1187

Closed realzhujunhao closed 1 year ago

realzhujunhao commented 1 year ago

What's the output of :CocInfo

versions

vim version: NVIM v0.8.2 node version: v20.4.0 coc.nvim version: 0.0.82-d1568d56 2023-09-29 19:43:34 +0800 coc.nvim directory: /Users/junhaozhu/.local/share/nvim/site/pack/packer/start/coc.nvim term: xterm-256color platform: darwin

Log of coc.nvim

2023-10-02T17:28:38.595 ERROR (pid:27718) [extensions-index] - Error on load package.json of coc-cl Error: main file lib/index.js not found, you may need to build the project. at z7 (/Users/junhaozhu/.local/share/nvim/site/pack/packer/start/coc.nvim/build/index.js:251:21268) at async gF.globalExtensions (/Users/junhaozhu/.local/share/nvim/site/pack/packer/start/coc.nvim/build/index.js:252:7107) at async gF.init (/Users/junhaozhu/.local/share/nvim/site/pack/packer/start/coc.nvim/build/index.js:252:3671) at async Gy.init (/Users/junhaozhu/.local/share/nvim/site/pack/packer/start/coc.nvim/build/index.js:277:45414) at async EventEmitter. (/Users/junhaozhu/.local/share/nvim/site/pack/packer/start/coc.nvim/build/index.js:277:47234) 2023-10-02T17:28:38.753 WARN (pid:27718) [workspace] - Extension "coc-lists" registered synchronized autocmd "VimLeavePre", which could be slow. 2023-10-02T17:28:38.771 INFO (pid:27718) [plugin] - coc.nvim initialized with node: v20.4.0 after 236 2023-10-02T17:28:40.917 INFO (pid:27718) [configurations] - Add folder configuration from file: /Users/junhaozhu/Documents/fleet/.vim/coc-settings.json 2023-10-02T17:28:40.952 INFO (pid:27718) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting 2023-10-02T17:28:40.958 INFO (pid:27718) [language-client-index] - Language server "rust-analyzer" started with 27731 2023-10-02T17:28:40.965 INFO (pid:27718) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running 2023-10-02T17:28:40.981 INFO (pid:27718) [services] - service rust-analyzer started 2023-10-02T17:28:44.899 INFO (pid:27718) [attach] - receive notification: showInfo []

What's the output of :CocCommand rust-analyzer.serverVersion

image

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

Screenshot 2023-10-02 at 5 25 48 PM

Few days ago there was a "i32" at the end of let a = 12, and "&str" for the next line, "char" for the last line. For some reason the inlay type hint has disappeared. : (

realzhujunhao commented 1 year ago
image

This is what I've tried (changing :CocConfig) but it did not work

fannheyward commented 1 year ago

You're using nvim 0.8.2, 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, this is nightly now.