diff options
author | Aleksey Kladov <[email protected]> | 2020-10-02 14:45:09 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-10-02 15:45:08 +0100 |
commit | 8716c4cec3a05ba891b20b5f28df69d925b913ad (patch) | |
tree | e2f073c459e9a1e1c98b98d524565633524b84c2 /crates/ide/src/lib.rs | |
parent | 700c9bc019346a321d230c51bbea597a497bed84 (diff) |
Move ide::AnalysisChange -> base_db::Change
This seems like a better factoring logically; ideally, clients shouldn't touch
`set_` methods of the database directly. Additionally, I think this
should remove the unfortunate duplication in fixture code.
Diffstat (limited to 'crates/ide/src/lib.rs')
-rw-r--r-- | crates/ide/src/lib.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ide/src/lib.rs b/crates/ide/src/lib.rs index bab3ec1ff..073b766a5 100644 --- a/crates/ide/src/lib.rs +++ b/crates/ide/src/lib.rs | |||
@@ -87,12 +87,11 @@ pub use assists::{ | |||
87 | utils::MergeBehaviour, Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist, | 87 | utils::MergeBehaviour, Assist, AssistConfig, AssistId, AssistKind, ResolvedAssist, |
88 | }; | 88 | }; |
89 | pub use base_db::{ | 89 | pub use base_db::{ |
90 | Canceled, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot, | 90 | Canceled, Change, CrateGraph, CrateId, Edition, FileId, FilePosition, FileRange, SourceRoot, |
91 | SourceRootId, | 91 | SourceRootId, |
92 | }; | 92 | }; |
93 | pub use hir::{Documentation, Semantics}; | 93 | pub use hir::{Documentation, Semantics}; |
94 | pub use ide_db::{ | 94 | pub use ide_db::{ |
95 | change::AnalysisChange, | ||
96 | label::Label, | 95 | label::Label, |
97 | line_index::{LineCol, LineIndex}, | 96 | line_index::{LineCol, LineIndex}, |
98 | search::SearchScope, | 97 | search::SearchScope, |
@@ -141,7 +140,7 @@ impl AnalysisHost { | |||
141 | 140 | ||
142 | /// Applies changes to the current state of the world. If there are | 141 | /// Applies changes to the current state of the world. If there are |
143 | /// outstanding snapshots, they will be canceled. | 142 | /// outstanding snapshots, they will be canceled. |
144 | pub fn apply_change(&mut self, change: AnalysisChange) { | 143 | pub fn apply_change(&mut self, change: Change) { |
145 | self.db.apply_change(change) | 144 | self.db.apply_change(change) |
146 | } | 145 | } |
147 | 146 | ||
@@ -195,7 +194,7 @@ impl Analysis { | |||
195 | file_set.insert(file_id, VfsPath::new_virtual_path("/main.rs".to_string())); | 194 | file_set.insert(file_id, VfsPath::new_virtual_path("/main.rs".to_string())); |
196 | let source_root = SourceRoot::new_local(file_set); | 195 | let source_root = SourceRoot::new_local(file_set); |
197 | 196 | ||
198 | let mut change = AnalysisChange::new(); | 197 | let mut change = Change::new(); |
199 | change.set_roots(vec![source_root]); | 198 | change.set_roots(vec![source_root]); |
200 | let mut crate_graph = CrateGraph::default(); | 199 | let mut crate_graph = CrateGraph::default(); |
201 | // FIXME: cfg options | 200 | // FIXME: cfg options |