Skip to content

RA does not work at all when offline #12499

Open
@RalfJung

Description

@RalfJung

I tried to do a bit of coding on rustc while on a plane without internet, and noticed that RA handles this situation quite badly. cargo metadata fails because it cannot refresh the index, and then basically nothing works, even though everything needed should be available offline. In particular, not even "check on save" does anything -- I had to run ./x.py check by hand. That worked perfectly fine, demonstrating that RA could also have run x.py as usual and show the diagnostics in the editor.

rust-analyzer version: ad6810e 2022-06-06 stable

rustc version: rustc 1.63.0-nightly (e09449220 2022-05-31)

relevant settings:

{
    "rust-analyzer.checkOnSave.enable": true,
    "rust-analyzer.checkOnSave.overrideCommand": [
        "./x.py",
        "check",
        "--json-output",
        "library/std",
        "compiler/rustc",
    ],
    "rust-analyzer.rustfmt.overrideCommand": [
        "./build/x86_64-unknown-linux-gnu/stage0/bin/rustfmt",
        "--edition=2021"
    ],
    "rust-analyzer.procMacro.enable": false,
    "editor.formatOnSave": false,
    "files.watcherExclude": {
        "*rustc*/src/llvm-project/**": true,
        "*rustc*/build/**": true,
    },
    "files.exclude": {
        "src/llvm-project/**": true,
        "build/**": true
    },
    "rust-analyzer.cargo.buildScripts.enable": false,
    "rust-analyzer.rustc.source": "./Cargo.toml",
    "rust-analyzer.hover.actions.references.enable": true,
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargocargo related issuesC-supportCategory: support questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions