Open compiler-errors opened 1 week ago
Duplicated https://github.com/rust-lang/rust-analyzer/issues/18228, https://github.com/rust-lang/rust-analyzer/issues/17575. Funny enough that Alexendoo's report was also reported from working on rustc.
Also I will note that I'm happy to help out with live-debugging this, if anyone needs help reproducing it. This happens almost constantly IME, so it shouldn't be too hard to repro on my side.
Also, specifically, is there any way for me to get rust-analyzer to just gracefully restart itself when it gets stuck in this situation? I don't want to flat-out, but basically rust-analyzer is getting itself stuck due to some new regression that has happened in the last few weeks or so, and I have basically no idea what to do at this point.
It should be gracefully restarting, but if it's fully crashing... well, we're talking on this issue. For debugging, it might be useful to run the command (accessible through the VS Code Command Palette; Command + Shift + P
) rust-analyzer (debug command): Show Syntax Tree
and pasting the resulting output in a gist. This might be useful if the crash is in the file you're editing, but it's in a dependency... I'm less confident about that.
@compiler-errors I got some time to go on a video call in the next couple hours?
Its not crashing, its getting into an inconsistent state wrt to the database causing everything to just panic. If it was crashing/panicking outside the catchers vscode would restart it properly.
I assume you have a ton of ram to spare right? :) Can you set "rust-analyzer.lru.capacity"
to something very high? Like 10000 (default is 128). That affects the LRU cache size for our parse queries (quadrupled for the macro ones iirc), curious to see if that reduces the frequency of this. (might need to restart when changing that I don't remember)
rust-analyzer version: rust-analyzer version: 0.4.2156-standalone [/home/mgx/.vscode-server/extensions/rust-lang.rust-analyzer-0.4.2156-linux-x64/server/rust-analyzer]
rustc version: bootstrap rustc, so it should be beta 1.83.0-beta.2
editor or extension: vscode
relevant settings: I'm building in rustc, so the default
.vscode/settings.json
that it ships on./x.py setup
.repository link (if public, optional): rustc
repro: I have none, since it happens when editing code in the codebase.
Every 5 minutes or so, rust-analyzer catastrophically begins failing with:
Interestingly:
Given:
Notice that
SyntaxNodePtr { kind: FN, range: 482..770 }
exists in that list 🤔 Is this an off-by-one bug somewhere in syntax expansion or something in r-a? Is there some way that r-a can actually share what these syntax nodes are called or render their spans more gracefully so I could debug what their origin is?Also, specifically, is there any way for me to get rust-analyzer to just gracefully restart itself when it gets stuck in this situation? I don't want to flat-out, but basically rust-analyzer is getting itself stuck due to some new regression that has happened in the last few weeks or so, and I have basically no idea what to do at this point.
I am basically being barraged with toaster popups from vscode when I do anything (move my cursor, type a character, look at vscode wrong) until I restart rust-analyzer. I've had to CTRL + SHIFT + P > restart rust analyzer basically every 5 minutes (like, literally hundreds of times) for weeks now.