rust-lang / rust-lang/rust-analyzer
Enable an offline mode that passes `--offline` to cargo
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
When working in slow or no internet situations, RA seems to lock the registry/workspace trying to do internet things. It can be tricky to cancel these operations.
My suggestion is to add a new offline mode that can be toggled via the menu. This can either set the environment variable (CARGO_NET_OFFLINE=true) or pass --offline to each cargo command (I'd prefer this so it's easy to tell the mode is being used). This would be two new menu options:
- "rust-analyzer: Enable offline mode": cancel any running operations, set the flag, and relaunch anything in progress
- "rust-analyzer: Disable offline mode": allow running operations to complete, remove --offline flag
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how rust-analyzer exposes menu options and launches cargo commands. Determine where running operations can be cancelled or relaunched, then implement enable and disable offline actions that apply or remove --offline. Done means the mode is visible and toggleable, active operations follow the requested behavior, and cargo commands run without network access when enabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100