rust-lang / rust-lang/rust-analyzer

Using `rust-analyzer` with worktrees causes file watcher to watch every worktree

Open
#16,534 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When I use rust-analyzer within a repo that uses git worktrees, one directory for each branch, r-a watches all the directories within the repo. Then runs many cargo instances (this is a Rust repo). This chokes my whole system.

Is it possible to configure the file watcher to more finely?

FTR I have ~ 90 worktrees in the repo at the moment.

Thanks

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 by reproducing the issue with rust-analyzer in a repository containing many Git worktrees, then observe which directories the file watcher covers and how many cargo instances are launched. Investigate the file-watching and worktree handling entry points, and consider the issue done when unrelated worktrees are excluded or can be configured without disrupting the active worktree.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, rust
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.