]> git.lizzy.rs Git - rust.git/commitdiff
Fix panic in batch analysis
authorAleksey Kladov <aleksey.kladov@gmail.com>
Sun, 24 Nov 2019 09:06:00 +0000 (12:06 +0300)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Sun, 24 Nov 2019 09:06:00 +0000 (12:06 +0300)
Closes #2272

crates/ra_batch/src/lib.rs

index df49eb13d123e738a157cfef5416aa28ed87de45..cb389eb26127e81302ade027570ee80b5e80b6fc 100644 (file)
@@ -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
                 }
             }