rust-lang / rust-lang/rust-analyzer

.flatpak-builder directory makes rust-analyzer take all the RAM

Open
#14,522 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

flatpak-builder generates a cache directory .flatpak-builder (see flatpak-builder reference) which causes rust-analyzer to take all the memory of your PC. When rust-analyzer begins to take all the memory, the server doesn't get killed when you close VSCode. Emacs lsp-mode also didn't do it.

Adding the .flatpak-builder directory to the exclude vector in /workspaces/rust-analyzer/crates/project-model/src/workspace.rs would be a solution, but I think that rust-analyzer should detect and exclude a directory like this in the first place.
Ignoring everything in a .gitignore file would be perfect!

rust-analyzer version: 0.3.1463

rustc version: 1.68.2

relevant settings: default

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 in crates/project-model/src/workspace.rs and inspect how the exclude vector and project directories are discovered. Compare the handling of .flatpak-builder with the issue's suggestion to honor .gitignore files. Done means flatpak-builder-generated files are excluded from workspace analysis without requiring manual configuration, while rust-analyzer remains usable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
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.