rust-lang/rust-analyzer

rust-analyzer freezes VS Code when cloning a repo

Closed this issue · 3 comments

Reproduction Steps

  1. Clone unikraft-cloud/examples repo.
  2. rust-analyzer automatically updates almost 3k files behind the scenes.
  3. I'm unable to discard the changes through the VS Code UI because of the sheer amount of updated files which cause the entire IDE to lag or freeze. Even running git commands from the terminal doesn't resolve the issue.
Image Image

That just happens because of running flychecks(cargo check as subprocesses) on each cargo workspaces inside the repository and they don't have necessary git ignore config for target directories. (I think that the repository is not organized well) You can disable flycheck, add gitignore or open single workspace rather than opening the repository root

And this is definitely not a bug

As @ShoyuVanilla said, you should add the target directory to .gitignore.