rust-lang / rust-lang/rust-analyzer

Rethink our VFS abstraction

Open
#18,948 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The current setup is brittle and tends to break very easily in unexpected ways (https://github.com/rust-lang/rust-analyzer/issues/18886#issuecomment-2594784549 being an example). The system is also somewhat difficult to follow (the way we partition the VFS into sourceroots is not easily understandable). We should simplify this and clean it up. One idea we've had is to first and foremost move the VFS state into salsa (once we have migrated over to the new one), as currently we have a weird middle ground between the two (some info is outside salsa, some is inside). The other thing is that we need to likely add support for lazily loading file contents (which likely means incurring i/o within salsa queries).

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 tracing the current VFS state, how it is partitioned into sourceroots, and which parts are inside or outside salsa. Review the migration to the new salsa and the lazy file-content loading requirement; done means a simpler VFS abstraction with consistent state ownership and support for loading contents on demand.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.