fannheyward / coc-rust-analyzer

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

Again no Support for standalone files (no Cargo.toml) #1014

Closed NiciTheNici closed 2 years ago

NiciTheNici commented 2 years ago

Identical to the original #828 issue (preferably reopen that one). I have asked multiple peers who could confirm the same behavior.

What's the output of :CocInfo

## versions

vim version: NVIM v0.7.2
node version: v16.15.1
coc.nvim version: 0.0.81-2522eee5 2022-06-14 19:03:29 +0800
coc.nvim directory: /home/nici/.config/nvim/autoload/plugged/coc.nvim
term: alacritty
platform: linux

## Log of coc.nvim

2022-07-04T23:25:39.995 INFO (pid:3012) [services] - registered service "rust-analyzer"
2022-07-04T23:25:39.996 INFO (pid:3012) [services] - Rust Analyzer Language Server state change: stopped => starting
2022-07-04T23:25:39.997 INFO (pid:3012) [plugin] - coc.nvim initialized with node: v16.15.1 after 96ms
2022-07-04T23:25:40.005 INFO (pid:3012) [language-client-index] - Language server "rust-analyzer" started with 3024
2022-07-04T23:25:40.031 INFO (pid:3012) [services] - Rust Analyzer Language Server state change: starting => running
2022-07-04T23:25:40.037 INFO (pid:3012) [services] - service rust-analyzer started
2022-07-04T23:30:49.946 INFO (pid:3012) [attach] - receive notification: showInfo []
2022-07-04T23:31:24.373 INFO (pid:3012) [attach] - receive notification: showInfo []

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

[coc.nvim] rust-analyzer 0.0.0 (75b22326d 2022-07-03)
fannheyward commented 2 years ago

Test steps on macOS with coc-rust-analyzer v0.65.1 and rust-analyzer 2022-07-03

  1. cd /tmp
  2. echo 'fn main() {\n println!("hello");\n}' > foo.rs
  3. nvim foo.rs, indexing works
截屏2022-07-05 11 07 18

Updated: looks like there's something broken with rust-analyzer:

截屏2022-07-05 11 11 22 截屏2022-07-05 11 11 57

There's no error on bar, code action on bar works as expected.

Updated: same on VS Code + rust-analyzer code foo.rs:

截屏2022-07-05 11 14 47
shafouz commented 2 years ago

@fannheyward how do you get the different color completion like this:

fannheyward commented 2 years ago

@shafouz coc.nvim 0.0.82 provides custom completion menu https://github.com/neoclide/coc.nvim/pull/3862