aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide_api/src/mock_analysis.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
committerAleksey Kladov <[email protected]>2019-02-08 11:49:43 +0000
commit12e3b4c70b5ef23b2fdfc197296d483680e125f9 (patch)
tree71baa0e0a62f9f6b61450501c5f821f67badf9e4 /crates/ra_ide_api/src/mock_analysis.rs
parent5cb1d41a30d25cbe136402644bf5434dd667f1e5 (diff)
reformat the world
Diffstat (limited to 'crates/ra_ide_api/src/mock_analysis.rs')
-rw-r--r--crates/ra_ide_api/src/mock_analysis.rs9
1 files changed, 2 insertions, 7 deletions
diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs
index 834b30541..8d8603062 100644
--- a/crates/ra_ide_api/src/mock_analysis.rs
+++ b/crates/ra_ide_api/src/mock_analysis.rs
@@ -41,10 +41,7 @@ impl MockAnalysis {
41 let mut res = MockAnalysis::new(); 41 let mut res = MockAnalysis::new();
42 for entry in parse_fixture(fixture) { 42 for entry in parse_fixture(fixture) {
43 if entry.text.contains(CURSOR_MARKER) { 43 if entry.text.contains(CURSOR_MARKER) {
44 assert!( 44 assert!(position.is_none(), "only one marker (<|>) per fixture is allowed");
45 position.is_none(),
46 "only one marker (<|>) per fixture is allowed"
47 );
48 position = Some(res.add_file_with_position(&entry.meta, &entry.text)); 45 position = Some(res.add_file_with_position(&entry.meta, &entry.text));
49 } else { 46 } else {
50 res.add_file(&entry.meta, &entry.text); 47 res.add_file(&entry.meta, &entry.text);
@@ -97,9 +94,7 @@ impl MockAnalysis {
97 let other_crate = crate_graph.add_crate_root(file_id); 94 let other_crate = crate_graph.add_crate_root(file_id);
98 let crate_name = path.parent().unwrap().file_name().unwrap(); 95 let crate_name = path.parent().unwrap().file_name().unwrap();
99 if let Some(root_crate) = root_crate { 96 if let Some(root_crate) = root_crate {
100 crate_graph 97 crate_graph.add_dep(root_crate, crate_name.into(), other_crate).unwrap();
101 .add_dep(root_crate, crate_name.into(), other_crate)
102 .unwrap();
103 } 98 }
104 } 99 }
105 change.add_file(source_root, file_id, path, Arc::new(contents)); 100 change.add_file(source_root, file_id, path, Arc::new(contents));