VFS no longer stores all source files in memory

This commit is contained in:
Lukas Wirth 2024-01-07 20:31:56 +01:00
parent af40101841
commit 1c40ac79c8
9 changed files with 130 additions and 143 deletions

View file

@ -331,9 +331,8 @@ fn load_crate_graph(
}
let changes = vfs.take_changes();
for file in changes {
if file.exists() {
let contents = vfs.file_contents(file.file_id);
if let Ok(text) = std::str::from_utf8(contents) {
if let vfs::Change::Create(v) | vfs::Change::Modify(v) = file.change {
if let Ok(text) = std::str::from_utf8(&v) {
analysis_change.change_file(file.file_id, Some(text.into()))
}
}