aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_ide/src/mock_analysis.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_ide/src/mock_analysis.rs')
-rw-r--r--crates/ra_ide/src/mock_analysis.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ra_ide/src/mock_analysis.rs b/crates/ra_ide/src/mock_analysis.rs
index 081aaee8c..f4cd6deb7 100644
--- a/crates/ra_ide/src/mock_analysis.rs
+++ b/crates/ra_ide/src/mock_analysis.rs
@@ -124,28 +124,28 @@ impl MockAnalysis {
124} 124}
125 125
126/// Creates analysis from a multi-file fixture, returns positions marked with <|>. 126/// Creates analysis from a multi-file fixture, returns positions marked with <|>.
127pub fn analysis_and_position(fixture: &str) -> (Analysis, FilePosition) { 127pub fn analysis_and_position(ra_fixture: &str) -> (Analysis, FilePosition) {
128 let (mock, position) = MockAnalysis::with_files_and_position(fixture); 128 let (mock, position) = MockAnalysis::with_files_and_position(ra_fixture);
129 (mock.analysis(), position) 129 (mock.analysis(), position)
130} 130}
131 131
132/// Creates analysis for a single file. 132/// Creates analysis for a single file.
133pub fn single_file(code: &str) -> (Analysis, FileId) { 133pub fn single_file(ra_fixture: &str) -> (Analysis, FileId) {
134 let mut mock = MockAnalysis::new(); 134 let mut mock = MockAnalysis::new();
135 let file_id = mock.add_file("/main.rs", code); 135 let file_id = mock.add_file("/main.rs", ra_fixture);
136 (mock.analysis(), file_id) 136 (mock.analysis(), file_id)
137} 137}
138 138
139/// Creates analysis for a single file, returns position marked with <|>. 139/// Creates analysis for a single file, returns position marked with <|>.
140pub fn single_file_with_position(code: &str) -> (Analysis, FilePosition) { 140pub fn single_file_with_position(ra_fixture: &str) -> (Analysis, FilePosition) {
141 let mut mock = MockAnalysis::new(); 141 let mut mock = MockAnalysis::new();
142 let pos = mock.add_file_with_position("/main.rs", code); 142 let pos = mock.add_file_with_position("/main.rs", ra_fixture);
143 (mock.analysis(), pos) 143 (mock.analysis(), pos)
144} 144}
145 145
146/// Creates analysis for a single file, returns range marked with a pair of <|>. 146/// Creates analysis for a single file, returns range marked with a pair of <|>.
147pub fn single_file_with_range(code: &str) -> (Analysis, FileRange) { 147pub fn single_file_with_range(ra_fixture: &str) -> (Analysis, FileRange) {
148 let mut mock = MockAnalysis::new(); 148 let mut mock = MockAnalysis::new();
149 let pos = mock.add_file_with_range("/main.rs", code); 149 let pos = mock.add_file_with_range("/main.rs", ra_fixture);
150 (mock.analysis(), pos) 150 (mock.analysis(), pos)
151} 151}