diff options
Diffstat (limited to 'crates/ra_analysis/src/lib.rs')
-rw-r--r-- | crates/ra_analysis/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_analysis/src/lib.rs b/crates/ra_analysis/src/lib.rs index b806c974d..8882feca3 100644 --- a/crates/ra_analysis/src/lib.rs +++ b/crates/ra_analysis/src/lib.rs | |||
@@ -44,8 +44,9 @@ pub use ra_db::{ | |||
44 | 44 | ||
45 | #[derive(Default)] | 45 | #[derive(Default)] |
46 | pub struct AnalysisChange { | 46 | pub struct AnalysisChange { |
47 | new_roots: Vec<SourceRootId>, | ||
47 | roots_changed: FxHashMap<SourceRootId, RootChange>, | 48 | roots_changed: FxHashMap<SourceRootId, RootChange>, |
48 | files_changed: Vec<(FileId, String)>, | 49 | files_changed: Vec<(FileId, Arc<String>)>, |
49 | libraries_added: Vec<LibraryData>, | 50 | libraries_added: Vec<LibraryData>, |
50 | crate_graph: Option<CrateGraph>, | 51 | crate_graph: Option<CrateGraph>, |
51 | } | 52 | } |
@@ -93,6 +94,9 @@ impl AnalysisChange { | |||
93 | pub fn new() -> AnalysisChange { | 94 | pub fn new() -> AnalysisChange { |
94 | AnalysisChange::default() | 95 | AnalysisChange::default() |
95 | } | 96 | } |
97 | pub fn add_root(&mut self, root_id: SourceRootId) { | ||
98 | self.new_roots.push(root_id); | ||
99 | } | ||
96 | pub fn add_file( | 100 | pub fn add_file( |
97 | &mut self, | 101 | &mut self, |
98 | root_id: SourceRootId, | 102 | root_id: SourceRootId, |
@@ -111,7 +115,7 @@ impl AnalysisChange { | |||
111 | .added | 115 | .added |
112 | .push(file); | 116 | .push(file); |
113 | } | 117 | } |
114 | pub fn change_file(&mut self, file_id: FileId, new_text: String) { | 118 | pub fn change_file(&mut self, file_id: FileId, new_text: Arc<String>) { |
115 | self.files_changed.push((file_id, new_text)) | 119 | self.files_changed.push((file_id, new_text)) |
116 | } | 120 | } |
117 | pub fn remove_file(&mut self, root_id: SourceRootId, file_id: FileId, path: RelativePathBuf) { | 121 | pub fn remove_file(&mut self, root_id: SourceRootId, file_id: FileId, path: RelativePathBuf) { |