From 730664f646aae36836c36c0cfdad382e0b1407f1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 24 Nov 2019 12:06:00 +0300 Subject: Fix panic in batch analysis Closes #2272 --- crates/ra_batch/src/lib.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/ra_batch') diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_batch/src/lib.rs index df49eb13d..cb389eb26 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_batch/src/lib.rs @@ -117,9 +117,12 @@ pub fn load( done = true; } } - VfsChange::AddFile { .. } - | VfsChange::RemoveFile { .. } - | VfsChange::ChangeFile { .. } => { + VfsChange::AddFile { root, file, path, text } => { + let source_root_id = vfs_root_to_id(root); + let file_id = vfs_file_to_id(file); + analysis_change.add_file(source_root_id, file_id, path, text); + } + VfsChange::RemoveFile { .. } | VfsChange::ChangeFile { .. } => { // We just need the first scan, so just ignore these } } -- cgit v1.2.3