rust-lang / rust-lang/rust-analyzer

RA performs some sort of (re)load when opening ui tests in a rustc checkout

Open
#23,160 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

Every time I open a new ui test that I haven't opened before, the status bar flashes like this:
https://github.com/user-attachments/assets/4a9bce84-4eaf-41d2-a5d6-1ef9205db890

It seems to be doing a bunch of work, including running ra-checks which is my configured check-on-save command.
This didn't use to happen, but I don't know exactly when it started. I tried older versions of the extension and I am still seeing this, so it seems like something outside RA changed, though I can't explain what that could be. (It definitely wasn't a VSCodium update, I didn't update VSCodium in forever. Though I now did update it and that didn't fix the problem either.) There's nothing appearing in the server logs under "output" either.

rust-analyzer version: rust-analyzer version: 0.3.2997-standalone [/home/r/.vscode-oss/extensions/rust-lang.rust-analyzer-0.3.2997-linux-x64/server/rust-analyzer]
but this also happens with nightly (0.4.3014)

rustc version: in a rustc checkout, so bootstrap I guess?

editor or extension: VSCodium

relevant settings:

{
    "rust-analyzer.linkedProjects": [
        "Cargo.toml",
        "library/Cargo.toml",
        "src/bootstrap/Cargo.toml",
        "compiler/rustc_codegen_cranelift/Cargo.toml",
        "compiler/rustc_codegen_gcc/Cargo.toml",
    ],
    "rust-analyzer.check.invocationStrategy": "once",
    "rust-analyzer.check.overrideCommand": [
        "./ra-check", "--json-output"
    ],
    "rust-analyzer.rustfmt.overrideCommand": [
        "${workspaceFolder}/build/host/rustfmt/bin/rustfmt",
        "--edition=2024",
    ],
    "rust-analyzer.procMacro.server": "${workspaceFolder}/build/host/stage0/libexec/rust-analyzer-proc-macro-srv",
    "rust-analyzer.cargo.buildScripts.invocationStrategy": "once",
    "rust-analyzer.cargo.buildScripts.overrideCommand": [
        "python3", "x.py", "check",
        "library", "compiler", "miri",
        "--json-output",
        "--compile-time-deps",
        "--set", "rust.download-rustc=false",
    ],
    "rust-analyzer.server.extraEnv": {
        "RUSTC": "${workspaceFolder}/build/host/stage0/bin/rustc",
        "CARGO": "${workspaceFolder}/build/host/stage0/bin/cargo",
    },
    "rust-analyzer.rustc.source": "./Cargo.toml",
    "rust-analyzer.cargo.sysrootSrc": "./library",
    "rust-analyzer.cargo.extraEnv": {
        "RUSTC_BOOTSTRAP": "1"
    },
    // Some diagnostics don't work properly here
    "rust-analyzer.diagnostics.enable": false, // due to <https://github.com/rust-lang/rust-analyzer/issues/13504>, we have too many errors
    //
    "files.watcherExclude": {
        "build": true,
    },
    "files.exclude": {
        "build": true
    },
}

repository link (if public, optional): https://github.com/rust-lang/rust/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reload/status-bar activity when opening a previously unopened UI test in the rustc checkout, using the listed linkedProjects, ra-check, x.py, and overrideCommand settings. Compare the behavior with server logs and check-on-save activity; done means identifying the trigger and preventing unintended reload or check work when opening the file.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.