New rust-analyzer immediately crashes with coc-rust-analyzer
It gives me the error:
The rust analyzer server crashed 5 times in the last 3 minutes. It will not be restarted
## versions
vim version: VIM - Vi IMproved 8.2 8021989
node version: v15.4.0
coc.nvim version: 0.0.79-67cc18bcbf
coc.nvim directory: /home/tyler/.vim_runtime/my_plugins/coc.nvim
term: dumb
platform: linux
## Log of coc.nvim
2020-12-21T09:40:02.780 INFO (pid:444039) [services] - registered service "rust-analyzer"
2020-12-21T09:40:02.783 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: stopped => starting
2020-12-21T09:40:02.797 INFO (pid:444039) [language-client-index] - Language server "rust-analyzer" started with 444051
2020-12-21T09:40:02.825 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: starting => stopped
2020-12-21T09:40:02.825 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: stopped => starting
2020-12-21T09:40:02.831 INFO (pid:444039) [language-client-index] - Language server "rust-analyzer" started with 444055
2020-12-21T09:40:02.835 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: starting => stopped
2020-12-21T09:40:02.835 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: stopped => starting
2020-12-21T09:40:02.838 INFO (pid:444039) [language-client-index] - Language server "rust-analyzer" started with 444058
2020-12-21T09:40:02.841 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: starting => stopped
2020-12-21T09:40:02.841 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: stopped => starting
2020-12-21T09:40:02.844 INFO (pid:444039) [language-client-index] - Language server "rust-analyzer" started with 444061
2020-12-21T09:40:02.847 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: starting => stopped
2020-12-21T09:40:02.847 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: stopped => starting
2020-12-21T09:40:02.850 INFO (pid:444039) [language-client-index] - Language server "rust-analyzer" started with 444064
2020-12-21T09:40:02.853 INFO (pid:444039) [services] - Rust Analyzer Language Server state change: starting => stopped
2020-12-21T09:40:03.755 WARN (pid:444039) [extensions] - Extension coc-rust-analyzer activate cost more than 1s
2020-12-21T09:40:03.765 INFO (pid:444039) [plugin] - coc.nvim 0.0.79-67cc18bcbf initialized with node: v15.4.0 after 1080ms
edit: any easy way to downgrade until this gets fixed?
Yeah, having the same issue :(
Failed to deserialize InitializeParams: missing field `changeAnnotationSupport`;
https://github.com/fannheyward/coc-rust-analyzer/issues/532
CC https://github.com/gluon-lang/lsp-types/pull/193
Can we see what InitializeParams is in this case?
@dessalines Saw your edit. We have a workaround in fannheyward/coc-rust-analyzer#532
coc-rust-analyzer v0.24.0 has fixed this.
@kjeremy this failure is caused by some capabilities are missing:
capabilities.workspace.workspaceEdit.normalizesLineEndingscapabilities.workspace.workspaceEdit.changeAnnotationSupportcapabilities.textDocument.rename.prepareSupportDefaultBehavior
Why was this closed? All the capabilities listed by @fannheyward are supposedly optional (provided I've read the spec correctly). So RA should either list a minimum supported protocol version or try to fallback gracefully, no?
Experienced this in Spacemacs and had to downgrade to 2020-12-14. Not sure if Emacs lsp-mode will support the newer LSP spec yet.
Cannot activate rust-analyzer: bootstrap error. See the logs in "OUTPUT > Rust Analyzer Client" (should open automatically). To enable verbose logs use { "rust-analyzer.trace.extension": true }
We've worked around this in nvim-lspconfig using the same mitigation as coc, but I think there should be a tracking issue as I believe this is not in compliance with the LSP spec . See: https://github.com/neovim/nvim-lspconfig/pull/481
This seems to be fixed on latest rust-analyzer (bcb9ae18de1fa405eb2add56409ae264267607bb). It no longer crashes when the new capabilities are not sent in "initialize".
it's still crash
INFO [2021/2/17 上午10:38:11]: Extension version: 0.2.489
INFO [2021/2/17 上午10:38:11]: Using configuration {
cargoRunner: null,
runnableEnv: null,
inlayHints: {
enable: true,
chainingHints: true,
maxLength: null,
parameterHints: true,
typeHints: true
},
updates: { channel: 'stable', askBeforeDownload: true },
server: { path: null, extraEnv: null },
trace: { server: 'off', extension: false },
debug: {
engine: 'auto',
sourceFileMap: {
'/rustc/<id>': '${env:USERPROFILE}/.rustup/toolchains/<toolchain-id>/lib/rustlib/src/rust'
},
openDebugPane: false,
engineSettings: {}
},
assist: { importMergeBehavior: 'full', importPrefix: 'plain' },
callInfo: { full: true },
cargo: {
autoreload: true,
allFeatures: false,
features: [],
loadOutDirsFromCheck: false,
noDefaultFeatures: false,
target: null,
noSysroot: false
},
checkOnSave: {
enable: true,
allFeatures: null,
allTargets: true,
command: 'check',
noDefaultFeatures: null,
target: null,
extraArgs: [],
features: null,
overrideCommand: null
},
completion: {
addCallArgumentSnippets: true,
addCallParenthesis: true,
postfix: { enable: true },
autoimport: { enable: true }
},
diagnostics: {
enable: true,
enableExperimental: true,
disabled: [],
warningsAsHint: [],
warningsAsInfo: []
},
files: { watcher: 'client', excludeDirs: [] },
hoverActions: {
debug: true,
enable: true,
gotoTypeDef: true,
implementations: true,
run: true,
linksInHover: true
},
lens: {
debug: true,
enable: true,
implementations: true,
run: true,
methodReferences: false,
references: false
},
linkedProjects: [],
lruCapacity: null,
notifications: { cargoTomlNotFound: true },
procMacro: { enable: false, server: null },
runnables: { overrideCargo: null, cargoExtraArgs: [] },
rustcSource: null,
rustfmt: { extraArgs: [], overrideCommand: null }
}