Rust-analyzer stopped working (MacOS 10.15.6)

I've been trying to figure this out for the last 2 days with no luck.

I've been testing out rust-analyzer for a month or two, to replace RLS in both vim (via ALE) and VSCode. It's been working until some time this week (I think roughly when I updated to rust 1.45.0).

Suddenly it doesn't seem to do anything at all, in either editor. I can see it in the list of running processes, both with vim or VSCode, but neither of them reports any errors or problems.

I've tried:

  • uninstall rust-analyzer (installed via homebrew), clear cache, reinstall
    • I noted that the homebrew installed version, which claims to be 2020-07-13, reports its version as rust-analyzer ???????
  • install the latest release from GitHub c9c518e (and specify that as the executable path, ensure the correct binary is running in my list of processes)
  • reboot
  • update MacOS
  • numerous bouts of closing and restarting VSCode and vim.
  • update vim and ALE
  • check for updates to VSCode
  • try a different rust project
  • try a different machine
  • try a different non-rust project (both editors still working with gopls)
  • search the forum and r/rust (it's not this since vim is affected)

rust-analyzer was working for me in both these editors earlier this week. What in the world is going on? I assume this is just a "me" problem, since I'm not seeing other reports or issues in the relevant repos.

Did perhaps my update to 1.45.0 break something?

$ rustup show
Default host: x86_64-apple-darwin
rustup home:  /Users/n8henrie/.rustup

installed targets for active toolchain
--------------------------------------

arm-unknown-linux-musleabihf
armv7-unknown-linux-gnueabihf
armv7-unknown-linux-musleabihf
thumbv7m-none-eabi
x86_64-apple-darwin

active toolchain
----------------

stable-x86_64-apple-darwin (default)
rustc 1.45.0 (5c1f21c3b 2020-07-13)
1 Like

Have you set rust-analyzer.serverPath in the vscode preferences?

Are there any error messages in the vscode console? Ctrl+Shift+P > "Developer: Toggle Developer Tools"

Hm, this is very curious, have no idea what might be wrong. Might be useful to poke at logs:

That's what I meant here -- have tried no set path, /usr/local/bin/rust-analyzer (homebrew), and a path to the one downloaded directly from github releases. Same behavior with all. I can verify that it is being launched in all causes ps aux | grep analyzer.

I see this -- is that a problem?

Extension 'matklad.rust-analyzer cannot use PROPOSED API (must started out of dev or enabled via --enable-proposed-api) updateEnableProposedApi @ abstractExtensionService.ts:500

EDIT: And once I start rust-analyzer:

[Extension Host] stack trace: Error: unknown request at handleResponse (/Users/n8henrie/.vscode/extensions/matklad.rust-analyzer-0.2.20200211-dev/out/main.js:3467:48) at processMessageQueue (/Users/n8henrie/.vscode/extensions/matklad.rust-analyzer-0.2.20200211-dev/out/main.js:3294:17) at Immediate. (/Users/n8henrie/.vscode/extensions/matklad.rust-analyzer-0.2.20200211-dev/out/main.js:3278:13) at processImmediate (internal/timers.js:439:21)
t.log @ console.ts:137
$logExtensionHostMessage @ mainThreadConsole.ts:39
_doInvokeHandler @ rpcProtocol.ts:402
_invokeHandler @ rpcProtocol.ts:387
_receiveRequest @ rpcProtocol.ts:303
_receiveOneMessage @ rpcProtocol.ts:230
(anonymous) @ rpcProtocol.ts:105
fire @ event.ts:587
fire @ ipc.net.ts:453
_receiveMessage @ ipc.net.ts:733
(anonymous) @ ipc.net.ts:592
fire @ event.ts:587
acceptChunk @ ipc.net.ts:239
(anonymous) @ ipc.net.ts:200
t @ ipc.net.ts:28
emit @ events.js:203
addChunk @ _stream_readable.js:295
readableAddChunk @ _stream_readable.js:276
Readable.push @ _stream_readable.js:210
onStreamRead @ internal/stream_base_commons.js:166

Huh -- an uninstall and reinstall of the VSCode extension fixed it there. I also now have a bunch of options that weren't there before in settings; I was installing all updates it prompted me for, not sure what happened. I specified the same homebrew-installed binary (instead of the built-in one) and working fine.

Still not working in vim / ALE, but this seems to make it much more likely to be a vim / ALE problem that just happened to pop up at the same time.

Uhu, 20200211 is a version from February

Huh. I'm usually a vim guy, decided to try VS Code because it is supposed to work better with rust-analyzer. It seems like it updates all the time, and I haven't disabled the extension auto-updating, so I'm not sure how the extension got out of date. But that does seem like a problem.

Looks like an issue with ALE affecting releases after 2020-07-06

I opened https://github.com/dense-analysis/ale/issues/3245

Sorry for the accidental submissions -- having a hard time figuring out the modifier keys to insert newline vs submit post.

Same issue with ALE on my Linux machine (Arch, up to date), but it looks like it is already fixed on master.

Running a couple bisects:

Introduced bug: 17edf50e2c8ce92a6f056e311d68000d64838873
Last bad: adc4bb540
Fixed bug: a32dd9c478fec0c21fa7416c267bdf1d2416b355

Haven't dug in any deeper since it seems resolved regardless -- hopefully should be back up and running on MacOS with the next release.

I had similar issue on Windows. But try clean command.
Then cargo build and then restart analyzer.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.