diff options
Diffstat (limited to 'crates/ra_analysis/src/imp.rs')
-rw-r--r-- | crates/ra_analysis/src/imp.rs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/crates/ra_analysis/src/imp.rs b/crates/ra_analysis/src/imp.rs index 0de0e2645..e2c20b0e3 100644 --- a/crates/ra_analysis/src/imp.rs +++ b/crates/ra_analysis/src/imp.rs | |||
@@ -51,9 +51,6 @@ impl AnalysisHostImpl { | |||
51 | .set(file_id, Arc::new(text)) | 51 | .set(file_id, Arc::new(text)) |
52 | } | 52 | } |
53 | if !(change.files_added.is_empty() && change.files_removed.is_empty()) { | 53 | if !(change.files_added.is_empty() && change.files_removed.is_empty()) { |
54 | let file_resolver = change | ||
55 | .file_resolver | ||
56 | .expect("change resolver when changing set of files"); | ||
57 | let mut source_root = SourceRoot::clone(&self.db.source_root(WORKSPACE)); | 54 | let mut source_root = SourceRoot::clone(&self.db.source_root(WORKSPACE)); |
58 | for (file_id, text) in change.files_added { | 55 | for (file_id, text) in change.files_added { |
59 | self.db | 56 | self.db |
@@ -70,7 +67,6 @@ impl AnalysisHostImpl { | |||
70 | .set(file_id, Arc::new(String::new())); | 67 | .set(file_id, Arc::new(String::new())); |
71 | source_root.files.remove(&file_id); | 68 | source_root.files.remove(&file_id); |
72 | } | 69 | } |
73 | source_root.file_resolver = file_resolver; | ||
74 | self.db | 70 | self.db |
75 | .query_mut(ra_db::SourceRootQuery) | 71 | .query_mut(ra_db::SourceRootQuery) |
76 | .set(WORKSPACE, Arc::new(source_root)) | 72 | .set(WORKSPACE, Arc::new(source_root)) |
@@ -95,10 +91,7 @@ impl AnalysisHostImpl { | |||
95 | .query_mut(ra_db::FileTextQuery) | 91 | .query_mut(ra_db::FileTextQuery) |
96 | .set_constant(file_id, Arc::new(text)); | 92 | .set_constant(file_id, Arc::new(text)); |
97 | } | 93 | } |
98 | let source_root = SourceRoot { | 94 | let source_root = SourceRoot { files }; |
99 | files, | ||
100 | file_resolver: library.file_resolver, | ||
101 | }; | ||
102 | self.db | 95 | self.db |
103 | .query_mut(ra_db::SourceRootQuery) | 96 | .query_mut(ra_db::SourceRootQuery) |
104 | .set(source_root_id, Arc::new(source_root)); | 97 | .set(source_root_id, Arc::new(source_root)); |