Skip to content

rust-analyzer config not working with bootstrap #1542

Closed
@Noratrieb

Description

@Noratrieb

I was talking to @jyn514 about what config to use to work on src/bootstrap and we couldn't figure out why it doesn't work for me.

We tried this config:

{
    "rust-analyzer.checkOnSave.overrideCommand": [
        "x",
        "check",
        "--json-output",
        "--build-dir",
        "build-rust-analyzer"
    ],
    "rust-analyzer.rustfmt.overrideCommand": [
        "./build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt",
        "--edition=2021"
    ],
    "rust-analyzer.procMacro.server": "./build/x86_64-unknown-linux-gnu/stage0/libexec/rust-analyzer-proc-macro-srv",
    "rust-analyzer.procMacro.enable": true,
    "rust-analyzer.cargo.buildScripts.enable": true,
    "rust-analyzer.cargo.buildScripts.invocationLocation": "root",
    "rust-analyzer.cargo.buildScripts.invocationStrategy": "once",
    "rust-analyzer.cargo.buildScripts.overrideCommand": [
        "x",
        "check",
        "--json-output",
    ],
    "rust-analyzer.cargo.sysroot": "./build/x86_64-unknown-linux-gnu/stage0-sysroot",
    "rust-analyzer.rustc.source": "./Cargo.toml",
    "rust-analyzer.linkedProjects": ["Cargo.toml", "src/bootstrap/Cargo.toml"],
}

This config works for working on bootstrap but breaks when I work on the compiler:

[ERROR rust_analyzer::main_loop] flycheck 1: File with cargo diagnostic not found in VFS: file not found: /home/nilsh/projects/rust/src/bootstrap/compiler/rustc_builtin_macros/src/format.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions