rust-lang / rust-lang/rust-analyzer

Feature Request: VS Code GUI to indicate paths to analyze

Open
#17,358 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello all,

  • Why: reduce context switching costs due to changing VS code windows
  • How: enable whole-linux-machine Rust Analyzer w/ path-to-cargo-toml toggles

This feature request is meant to resolve this issue where we're forced to work with VS code like this:

image

if we have to open each folder in a separate vs code window then it can become annoying to figure out which window is which and switch around, and there's not really enough room sometimes. It's great to be able to do that, but it's annoying to be forced to do that, if I make sense. If you randomly want to look at code from another repo, you need to hover over the vs code button and know which window (labeled by file open, not project open, mind you) to click on.

I want to be able to open VS code on the root of a Linux machine or from the home directory, and be able to tell Rust Analyzer which cargo.toml files to analyze, and be able to toggle paths on and off, would this be possible?
The main benefit would be, if we have a variety of projects to work on, if we just have the whole linux machine in VS code explorer, then we can more fluidly hop between different projects.

Here's a sketch of the proposal, this could potentially be recursive down into nested workspaces but that could be hard to fit into the available space, maybe
image

It might be good to have inside Cargo.toml not only a list of workspace members available, but also a separate list of which members to analyze. This would be a natural place to store information about what to analyze, although could yield merge conflicts if teammates work on different chunks of rust.

Once again, the main goal would just be to reduce the need to switch between various VS code windows to look at different rust crates, and adding a few checkboxes to potentially save us from switching windows millions of times sounds like a good deal to me.

However, as I'm a Rust newbie unfamiliar with this codebase, I can't ship this efficiently,

also,

  • I could be wrong about how to do this, and
  • I could be wrong about if it is even necessary,

Therefore, please feel welcome to chime in if you have better ideas to address the same issue or if you think it is not an issue (any good workarounds?)

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

The issue names no files, tests, or entry points. Start by reviewing VS Code workspace behavior and rust-analyzer's Cargo project discovery, then define how one window would select and toggle paths to analyze; done would mean multiple projects can be browsed without switching windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.