rust-lang / rust-lang/rust-analyzer

Add Vs Code commands to toggle `cargo watch` state

Open
#2,764 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-vscode E-hard S-actionable
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

We should add either

Rust Analyzer: Enable cargo watch and Rust Analyzer: Disable cargo watch

or a single

Rust Analyzer: Toggle cargo watch

Commands are added here: https://github.com/rust-analyzer/rust-analyzer/blob/d5abe4cfddd5c6e14100f20d27d3de38fe7201f5/editors/code/src/main.ts#L15

They also need to be specified in package.json:

https://github.com/rust-analyzer/rust-analyzer/blob/d5abe4cfddd5c6e14100f20d27d3de38fe7201f5/editors/code/package.json#L73

I think the command should just toggle the corresponding setting in the workspace file, and that should be, in theory, automatically propagated to the server.

I don't think we have a server-side implementation for this yet, we should add one.

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

Start with the command registration in editors/code/src/main.ts and the command declarations in editors/code/package.json. Trace how the cargo watch workspace setting is propagated to the server, then identify the server-side implementation needed for the command. Done means the VS Code command toggles cargo watch and the server responds to the updated setting.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, devtools
Issue type
Feature
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.