diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-01-07 12:27:17 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2021-01-07 12:27:17 +0000 |
commit | 7967ce85cfc5fc2b1996425b44f2a45d0841c8ff (patch) | |
tree | 4495b9de7ea6c8e9dd9fd347d42517e9dee511fa /crates/ide/src/fixture.rs | |
parent | c3e9fb183bc287d83b97b776edc87c54d18d1a73 (diff) | |
parent | 72b9a4fbd3c12f3250b9157a1d44230e04ec8b22 (diff) |
Merge #7184
7184: Changes Cursor Marker To $0 r=matklad a=kevaundray
Co-authored-by: Kevaundray Wedderburn <[email protected]>
Diffstat (limited to 'crates/ide/src/fixture.rs')
-rw-r--r-- | crates/ide/src/fixture.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/ide/src/fixture.rs b/crates/ide/src/fixture.rs index eb57f9224..cc8218885 100644 --- a/crates/ide/src/fixture.rs +++ b/crates/ide/src/fixture.rs | |||
@@ -20,12 +20,12 @@ pub(crate) fn files(ra_fixture: &str) -> (Analysis, Vec<FileId>) { | |||
20 | (host.analysis(), change_fixture.files) | 20 | (host.analysis(), change_fixture.files) |
21 | } | 21 | } |
22 | 22 | ||
23 | /// Creates analysis from a multi-file fixture, returns positions marked with <|>. | 23 | /// Creates analysis from a multi-file fixture, returns positions marked with $0. |
24 | pub(crate) fn position(ra_fixture: &str) -> (Analysis, FilePosition) { | 24 | pub(crate) fn position(ra_fixture: &str) -> (Analysis, FilePosition) { |
25 | let mut host = AnalysisHost::default(); | 25 | let mut host = AnalysisHost::default(); |
26 | let change_fixture = ChangeFixture::parse(ra_fixture); | 26 | let change_fixture = ChangeFixture::parse(ra_fixture); |
27 | host.db.apply_change(change_fixture.change); | 27 | host.db.apply_change(change_fixture.change); |
28 | let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker (<|>)"); | 28 | let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)"); |
29 | let offset = match range_or_offset { | 29 | let offset = match range_or_offset { |
30 | RangeOrOffset::Range(_) => panic!(), | 30 | RangeOrOffset::Range(_) => panic!(), |
31 | RangeOrOffset::Offset(it) => it, | 31 | RangeOrOffset::Offset(it) => it, |
@@ -33,12 +33,12 @@ pub(crate) fn position(ra_fixture: &str) -> (Analysis, FilePosition) { | |||
33 | (host.analysis(), FilePosition { file_id, offset }) | 33 | (host.analysis(), FilePosition { file_id, offset }) |
34 | } | 34 | } |
35 | 35 | ||
36 | /// Creates analysis for a single file, returns range marked with a pair of <|>. | 36 | /// Creates analysis for a single file, returns range marked with a pair of $0. |
37 | pub(crate) fn range(ra_fixture: &str) -> (Analysis, FileRange) { | 37 | pub(crate) fn range(ra_fixture: &str) -> (Analysis, FileRange) { |
38 | let mut host = AnalysisHost::default(); | 38 | let mut host = AnalysisHost::default(); |
39 | let change_fixture = ChangeFixture::parse(ra_fixture); | 39 | let change_fixture = ChangeFixture::parse(ra_fixture); |
40 | host.db.apply_change(change_fixture.change); | 40 | host.db.apply_change(change_fixture.change); |
41 | let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker (<|>)"); | 41 | let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)"); |
42 | let range = match range_or_offset { | 42 | let range = match range_or_offset { |
43 | RangeOrOffset::Range(it) => it, | 43 | RangeOrOffset::Range(it) => it, |
44 | RangeOrOffset::Offset(_) => panic!(), | 44 | RangeOrOffset::Offset(_) => panic!(), |
@@ -46,12 +46,12 @@ pub(crate) fn range(ra_fixture: &str) -> (Analysis, FileRange) { | |||
46 | (host.analysis(), FileRange { file_id, range }) | 46 | (host.analysis(), FileRange { file_id, range }) |
47 | } | 47 | } |
48 | 48 | ||
49 | /// Creates analysis from a multi-file fixture, returns positions marked with <|>. | 49 | /// Creates analysis from a multi-file fixture, returns positions marked with $0. |
50 | pub(crate) fn annotations(ra_fixture: &str) -> (Analysis, FilePosition, Vec<(FileRange, String)>) { | 50 | pub(crate) fn annotations(ra_fixture: &str) -> (Analysis, FilePosition, Vec<(FileRange, String)>) { |
51 | let mut host = AnalysisHost::default(); | 51 | let mut host = AnalysisHost::default(); |
52 | let change_fixture = ChangeFixture::parse(ra_fixture); | 52 | let change_fixture = ChangeFixture::parse(ra_fixture); |
53 | host.db.apply_change(change_fixture.change); | 53 | host.db.apply_change(change_fixture.change); |
54 | let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker (<|>)"); | 54 | let (file_id, range_or_offset) = change_fixture.file_position.expect("expected a marker ($0)"); |
55 | let offset = match range_or_offset { | 55 | let offset = match range_or_offset { |
56 | RangeOrOffset::Range(_) => panic!(), | 56 | RangeOrOffset::Range(_) => panic!(), |
57 | RangeOrOffset::Offset(it) => it, | 57 | RangeOrOffset::Offset(it) => it, |