fannheyward / coc-rust-analyzer

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

Code completion not working, but the LSP is on. #1192

Closed DoormatIka closed 1 year ago

DoormatIka commented 1 year ago

Nothing shows up on the rust file.

I tried:

What's the output of :CocInfo

## versions

vim version: NVIM v0.9.2
node version: v18.16.0
coc.nvim version: 0.0.82-d1568d56 2023-09-29 19:43:34 +0800
coc.nvim directory: C:\Users\muya\AppData\Local\nvim-data\site\pack\packer\start\coc.nvim
term: WezTerm
platform: win32

## Log of coc.nvim

2023-10-16T16:12:12.423 INFO (pid:15960) [plugin] - coc.nvim initialized with node: v18.16.0 after 228
2023-10-16T16:12:21.011 INFO (pid:15960) [attach] - receive notification: installExtensions [ 'coc-rust-analyzer' ]
2023-10-16T16:12:22.615 INFO (pid:15960) [extension-installer] - Fetched info of coc-rust-analyzer {
  'dist.tarball': 'https://registry.npmjs.org/coc-rust-analyzer/-/coc-rust-analyzer-0.74.0.tgz',
  'engines.coc': '^0.0.80',
  version: '0.74.0',
  name: 'coc-rust-analyzer'
}
2023-10-16T16:12:22.924 INFO (pid:15960) [model-download] - Download completed: URL {
  href: 'https://registry.npmjs.org/coc-rust-analyzer/-/coc-rust-analyzer-0.74.0.tgz',
  origin: 'https://registry.npmjs.org',
  protocol: 'https:',
  username: '',
  password: '',
  host: 'registry.npmjs.org',
  hostname: 'registry.npmjs.org',
  port: '',
  pathname: '/coc-rust-analyzer/-/coc-rust-analyzer-0.74.0.tgz',
  search: '',
  searchParams: URLSearchParams {},
  hash: ''
}
2023-10-16T16:12:22.928 INFO (pid:15960) [model-download] - Downloaded https://registry.npmjs.org/coc-rust-analyzer/-/coc-rust-analyzer-0.74.0.tgz => C:\Users\muya\AppData\Local\coc\extensions\node_modules\coc-rust-analyzer-09d1d493-def4-4125-b35b-0e45ea7ae887
2023-10-16T16:13:08.957 ERROR (pid:15960) [timing] - activate coc-rust-analyzer timeout after 5000ms
2023-10-16T16:13:17.589 INFO (pid:15960) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting
2023-10-16T16:13:17.869 INFO (pid:15960) [language-client-index] - Language server "rust-analyzer" started with 9144
2023-10-16T16:13:17.905 INFO (pid:15960) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running
2023-10-16T16:13:17.913 INFO (pid:15960) [services] - service rust-analyzer started
2023-10-16T16:16:29.974 INFO (pid:15960) [attach] - receive notification: doHover []
2023-10-16T16:16:31.603 INFO (pid:15960) [attach] - receive notification: doHover []
2023-10-16T16:18:00.058 INFO (pid:15960) [attach] - receive notification: showInfo []
2023-10-16T16:19:08.528 INFO (pid:15960) [attach] - Request action: commandList [ '', 'CocCommand ', 11 ]
2023-10-16T16:19:11.710 INFO (pid:15960) [attach] - Request action: commandList [ 'r', 'CocCommand r', 12 ]
2023-10-16T16:19:11.816 INFO (pid:15960) [attach] - Request action: commandList [ 're', 'CocCommand re', 13 ]
2023-10-16T16:19:12.647 INFO (pid:15960) [attach] - Request action: commandList [ 'r', 'CocCommand r', 12 ]
2023-10-16T16:19:12.829 INFO (pid:15960) [attach] - Request action: commandList [ '', 'CocCommand ', 11 ]
2023-10-16T16:19:16.764 INFO (pid:15960) [attach] - Request action: commandList [ '', 'CocCommand ', 11 ]
2023-10-16T16:19:17.755 INFO (pid:15960) [attach] - Request action: commandList [ 'w', 'CocCommand w', 12 ]
2023-10-16T16:19:17.869 INFO (pid:15960) [attach] - Request action: commandList [ 'wo', 'CocCommand wo', 13 ]
2023-10-16T16:19:18.049 INFO (pid:15960) [attach] - Request action: commandList [ 'wor', 'CocCommand wor', 14 ]
2023-10-16T16:19:18.137 INFO (pid:15960) [attach] - Request action: commandList [ 'work', 'CocCommand work', 15 ]
2023-10-16T16:19:24.730 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clearWatchma', 'CocCommand workspace.clearWatchma', 33 ]
2023-10-16T16:19:25.233 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clearWatchm', 'CocCommand workspace.clearWatchm', 32 ]
2023-10-16T16:19:25.264 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clearWatch', 'CocCommand workspace.clearWatch', 31 ]
2023-10-16T16:19:25.297 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clearWatc', 'CocCommand workspace.clearWatc', 30 ]
2023-10-16T16:19:25.329 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clearWat', 'CocCommand workspace.clearWat', 29 ]
2023-10-16T16:19:25.362 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clearWa', 'CocCommand workspace.clearWa', 28 ]
2023-10-16T16:19:25.383 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clearW', 'CocCommand workspace.clearW', 27 ]
2023-10-16T16:19:25.413 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clear', 'CocCommand workspace.clear', 26 ]
2023-10-16T16:19:25.443 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.clea', 'CocCommand workspace.clea', 25 ]
2023-10-16T16:19:25.473 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.cle', 'CocCommand workspace.cle', 24 ]
2023-10-16T16:19:25.504 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.cl', 'CocCommand workspace.cl', 23 ]
2023-10-16T16:19:25.534 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.c', 'CocCommand workspace.c', 22 ]
2023-10-16T16:19:25.563 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace.', 'CocCommand workspace.', 21 ]
2023-10-16T16:19:25.598 INFO (pid:15960) [attach] - Request action: commandList [ 'workspace', 'CocCommand workspace', 20 ]
2023-10-16T16:19:25.629 INFO (pid:15960) [attach] - Request action: commandList [ 'workspac', 'CocCommand workspac', 19 ]
2023-10-16T16:19:25.661 INFO (pid:15960) [attach] - Request action: commandList [ 'workspa', 'CocCommand workspa', 18 ]
2023-10-16T16:19:25.692 INFO (pid:15960) [attach] - Request action: commandList [ 'worksp', 'CocCommand worksp', 17 ]
2023-10-16T16:19:25.724 INFO (pid:15960) [attach] - Request action: commandList [ 'works', 'CocCommand works', 16 ]
2023-10-16T16:19:25.754 INFO (pid:15960) [attach] - Request action: commandList [ 'work', 'CocCommand work', 15 ]
2023-10-16T16:19:25.785 INFO (pid:15960) [attach] - Request action: commandList [ 'wor', 'CocCommand wor', 14 ]
2023-10-16T16:19:25.816 INFO (pid:15960) [attach] - Request action: commandList [ 'wo', 'CocCommand wo', 13 ]
2023-10-16T16:19:25.847 INFO (pid:15960) [attach] - Request action: commandList [ 'w', 'CocCommand w', 12 ]
2023-10-16T16:19:25.879 INFO (pid:15960) [attach] - Request action: commandList [ '', 'CocCommand ', 11 ]
2023-10-16T16:21:46.637 INFO (pid:15960) [attach] - receive notification: checkJsonExtension []
2023-10-16T16:21:51.042 INFO (pid:15960) [services] - LanguageClient Json language server state change: stopped => starting
2023-10-16T16:21:51.053 INFO (pid:15960) [language-client-index] - Language server "json" started with 13616
2023-10-16T16:21:51.168 INFO (pid:15960) [services] - LanguageClient Json language server state change: starting => running
2023-10-16T16:21:51.178 INFO (pid:15960) [services] - service json started
2023-10-16T16:22:50.254 INFO (pid:15960) [services] - LanguageClient Rust Analyzer Language Server state change: running => stopped
2023-10-16T16:22:50.257 INFO (pid:15960) [services] - LanguageClient Rust Analyzer Language Server state change: stopped => starting
2023-10-16T16:22:50.264 INFO (pid:15960) [language-client-index] - Language server "rust-analyzer" started with 5644
2023-10-16T16:22:50.274 INFO (pid:15960) [services] - LanguageClient Rust Analyzer Language Server state change: starting => running
2023-10-16T16:22:59.499 INFO (pid:15960) [attach] - receive notification: doHover []

What's the output of :CocCommand rust-analyzer.serverVersion rust-analyzer 0.3.1697-standalone (6572ec8d9 2023-10-15) **What's your coc-rust-analyzer version? You can get it from:CocList extensions** 0.74.0`

DoormatIka commented 1 year ago

It works when I start neovim inside the rust project folder, however when I try launching it from C:\Users\[username], it doesn't work. I'm using telescope to go to the rust project folder from C:\Users\[username].

It also happens when I switch to a different rust file after the first one I started on.

fannheyward commented 1 year ago

using telescope to go to the rust project folder

Looks like coc/coc-rust-analyzer didn't detect the root of your project after telescope choosing, workspace root didn't change.

Launch you nvim inside your project.