Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust-analyzer config not working with bootstrap #1542

Closed
Noratrieb opened this issue Jan 5, 2023 · 2 comments
Closed

rust-analyzer config not working with bootstrap #1542

Noratrieb opened this issue Jan 5, 2023 · 2 comments

Comments

@Noratrieb
Copy link
Member

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
@jyn514
Copy link
Member

jyn514 commented Mar 26, 2023

@Nilstrieb are you still running into this problem?

@Noratrieb
Copy link
Member Author

I'm not! Magic! I will report back if it starts being a problem again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants