rust-lang / rust-lang/rust-analyzer

Cached offline use regression since lock file copying was implemented

Open
#20,115 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

With Rust analyzer version 0.3.2509 for VSCode I was unable to use my typical workflow for working offline.

Before #20018 was merged I was able to connect to the internet, run cargo metadata, and as long as my crate versions didn't change I was able to continue using it offline.

I'm on a restricted machine where the main GUI desktop can't connect to the internet, but I can open up a shell that has internet access and I tend to run cargo fetch in that shell to get everything downloaded before using the GUI offline.

The issue now is that rust-analzyer is creating a new folder at target/rust-analyzer/metadata and since I haven't run cargo metadata in that folder ( since it doesn't exist until running the GUI with an internet connection ) the metadata isn't cached and rust-analyzer can't startup.

I realize that this is a little bit of a special case, but it still feels like maybe I should be able to have an option to run rust-analyzer against the normal cargo metadata location.

Originally posted by @zicklag in #12499

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

Reproduce the offline workflow described in the issue: run cargo fetch and cargo metadata, then compare the normal metadata location with target/rust-analyzer/metadata. Trace how rust-analyzer chooses that metadata directory. Done means the cached offline workflow can start without requiring metadata to be generated in the newly created directory.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.