diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-27 15:08:23 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2019-01-27 15:08:23 +0000 |
commit | b2b62b9579e9eefbce27b8a9b799fbd59438ce36 (patch) | |
tree | 42f0c90520885a66f5982aae3746dd9684b8da00 /crates/ra_ide_api/src/mock_analysis.rs | |
parent | 964086e0d4874d7e60eb3607220e486ec4b51f86 (diff) | |
parent | 154bce18644698f4e8ef2a2ad2bdd853f2f1e31c (diff) |
Merge #691
691: remove dead code r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/mock_analysis.rs')
-rw-r--r-- | crates/ra_ide_api/src/mock_analysis.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_ide_api/src/mock_analysis.rs b/crates/ra_ide_api/src/mock_analysis.rs index 846c76cfe..0f2d22ab2 100644 --- a/crates/ra_ide_api/src/mock_analysis.rs +++ b/crates/ra_ide_api/src/mock_analysis.rs | |||
@@ -2,7 +2,6 @@ use std::sync::Arc; | |||
2 | 2 | ||
3 | use relative_path::RelativePathBuf; | 3 | use relative_path::RelativePathBuf; |
4 | use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; | 4 | use test_utils::{extract_offset, extract_range, parse_fixture, CURSOR_MARKER}; |
5 | use ra_db::mock::FileMap; | ||
6 | 5 | ||
7 | use crate::{Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FilePosition, FileRange, SourceRootId}; | 6 | use crate::{Analysis, AnalysisChange, AnalysisHost, CrateGraph, FileId, FilePosition, FileRange, SourceRootId}; |
8 | 7 | ||
@@ -83,15 +82,14 @@ impl MockAnalysis { | |||
83 | } | 82 | } |
84 | pub fn analysis_host(self) -> AnalysisHost { | 83 | pub fn analysis_host(self) -> AnalysisHost { |
85 | let mut host = AnalysisHost::default(); | 84 | let mut host = AnalysisHost::default(); |
86 | let mut file_map = FileMap::default(); | ||
87 | let source_root = SourceRootId(0); | 85 | let source_root = SourceRootId(0); |
88 | let mut change = AnalysisChange::new(); | 86 | let mut change = AnalysisChange::new(); |
89 | change.add_root(source_root, true); | 87 | change.add_root(source_root, true); |
90 | let mut crate_graph = CrateGraph::default(); | 88 | let mut crate_graph = CrateGraph::default(); |
91 | for (path, contents) in self.files.into_iter() { | 89 | for (i, (path, contents)) in self.files.into_iter().enumerate() { |
92 | assert!(path.starts_with('/')); | 90 | assert!(path.starts_with('/')); |
93 | let path = RelativePathBuf::from_path(&path[1..]).unwrap(); | 91 | let path = RelativePathBuf::from_path(&path[1..]).unwrap(); |
94 | let file_id = file_map.add(path.clone()); | 92 | let file_id = FileId(i as u32 + 1); |
95 | if path == "/lib.rs" || path == "/main.rs" { | 93 | if path == "/lib.rs" || path == "/main.rs" { |
96 | crate_graph.add_crate_root(file_id); | 94 | crate_graph.add_crate_root(file_id); |
97 | } | 95 | } |