Description
rust-analyzer/crates/project-model/src/workspace.rs
Lines 86 to 96 in 9fca0a4
Ideally, you should be able to just open a random detached file in existing cargo projects, and get the basic features working. That needs some changes on the salsa-level though. In particular, we should split the unified CrateGraph (which currently has maximal durability) into proper crate graph, and a set of ad hoc roots (with minimal durability). Then, we need to hide the graph behind the queries such that most queries look only at the proper crate graph, and fall back to ad hoc roots only if there's no results. After this, we should be able to tweak the logic in reload.rs to add newly opened files, which don't belong to any existing crates, to the set of the detached files.
Fixing this would be beneficial to the rustlings project, removing the need for the rust-project.json generation step they currently employ.
Activity