fannheyward / coc-rust-analyzer

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

I stopped getting type hints #1051

Closed Clish254 closed 2 years ago

Clish254 commented 2 years ago

I was getting type hints before on variables but after uninstalling and installing coc-rust-analyzer again I stopped getting type hints. I've tried to search for a solution and added "rust-analyzer.inlayHints.enable": true to my coc-settings.json but i'm still getting the same issue. What's the output of :CocInfo Here is the output from :CocInfo

## versions

vim version: NVIM v0.8.0-dev-1064-g48e060f64
node version: v14.17.0
coc.nvim version: 0.0.80-03c9add7cd
coc.nvim directory: /home/clinton/.config/nvim/plugged/coc.nvim
term: tmux-256color
platform: linux

## Log of coc.nvim

2022-09-11T16:54:38.708 WARN (pid:464138) [attach] - Plugin not ready when received "registNotification" [ 'cquery', '$cquery/publishSemanticHighlighting' ]
2022-09-11T16:54:38.711 WARN (pid:464138) [attach] - Plugin not ready when received "registNotification" [ 'cquery', '$cquery/setInactiveRegions' ]
2022-09-11T16:54:38.712 WARN (pid:464138) [attach] - Plugin not ready when received "registNotification" [ 'ccls', '$ccls/publishSemanticHighlight' ]
2022-09-11T16:54:38.712 WARN (pid:464138) [attach] - Plugin not ready when received "registNotification" [ 'ccls', '$ccls/publishSkippedRanges' ]
2022-09-11T16:54:38.845 INFO (pid:464138) [services] - registered service "languageserver.golang"
2022-09-11T16:54:38.845 INFO (pid:464138) [services] - registered service "languageserver.ccls"
2022-09-11T16:54:38.869 INFO (pid:464138) [services] - registered service "highlight"
2022-09-11T16:54:39.034 INFO (pid:464138) [plugin] - coc.nvim 0.0.80-03c9add7cd initialized with node: v14.17.0 after 300ms
2022-09-11T16:54:39.038 INFO (pid:464138) [attach] - receive notification: registNotification [ 'cquery', '$cquery/publishSemanticHighlighting' ]
2022-09-11T16:54:39.038 INFO (pid:464138) [attach] - receive notification: registNotification [ 'cquery', '$cquery/setInactiveRegions' ]
2022-09-11T16:54:39.038 INFO (pid:464138) [attach] - receive notification: registNotification [ 'ccls', '$ccls/publishSemanticHighlight' ]
2022-09-11T16:54:39.038 INFO (pid:464138) [attach] - receive notification: registNotification [ 'ccls', '$ccls/publishSkippedRanges' ]
2022-09-11T16:55:07.315 INFO (pid:464138) [services] - registered service "rust-analyzer"
2022-09-11T16:55:07.315 INFO (pid:464138) [services] - Rust Analyzer Language Server state change: stopped => starting
2022-09-11T16:55:07.325 INFO (pid:464138) [language-client-index] - Language server "rust-analyzer" started with 464731
2022-09-11T16:55:07.335 INFO (pid:464138) [services] - Rust Analyzer Language Server state change: starting => running
2022-09-11T16:55:07.341 INFO (pid:464138) [services] - service rust-analyzer started
2022-09-11T16:55:12.213 INFO (pid:464138) [attach] - receive notification: showInfo []

What's the output of :CocCommand rust-analyzer.serverVersion rust-analyzer 0.3.1194-standalone (67920f797 2022-09-04)

fannheyward commented 2 years ago

Can't reproduce. Set "rust-analyzer.trace.server": "verbose" in your coc-settings.json, opening a rust file, then :CocCommand workspace.showOutput rust-analyzer, search textDocument/inlayHint in the logs.

ricardoseriani commented 2 years ago

My inlayHints has stopped too.

I created the gist following your recommendations.

Thanks in advance.

fannheyward commented 2 years ago

@ricardoseriani from your logs https://gist.github.com/ricardoseriani/845f97206078c969b5b96b88dcd6d3e3#file-rust-analyzer-L1078-L1080

rust-analyzer isn't ready to provide inlay hints. Please waiting rust-analyzer ready to work.

ricardoseriani commented 2 years ago

It seem that after entering vim insert mode and returning to normal mode the inlayHints start appearing. In fact, the hints starting appearing again after I add one blank line, using the letter O in normal mode, or better yet, after editing the file in any way (inserting some text, blank line, etc) Please, can you try this @Clish254 ?

Because if it is solves for you too, them we can narrow down the problem.

Clish254 commented 2 years ago

I switched to rust-tools @ricardoseriani

fannheyward commented 2 years ago

after editing the file in any way

Looks like it's related inlayHints fetching, will look into this.

fannheyward commented 2 years ago

@ricardoseriani what's your coc.nvim version? You can get it from :CocInfo.

ricardoseriani commented 2 years ago

vim version: VIM - Vi IMproved 9.0 9000432 node version: v16.16.0 coc.nvim version: 0.0.82-b6e723ca 2022-09-13 11:25:46 +0800

fannheyward commented 2 years ago

This has been fixed in coc.nvim master https://github.com/neoclide/coc.nvim/commit/ea87337b9275f043cd5273630e1a718bb4418888