diff options
Diffstat (limited to 'crates/ra_ide_api')
4 files changed, 15 insertions, 44 deletions
diff --git a/crates/ra_ide_api/src/extend_selection.rs b/crates/ra_ide_api/src/extend_selection.rs index cd2ebe471..f61feaf1b 100644 --- a/crates/ra_ide_api/src/extend_selection.rs +++ b/crates/ra_ide_api/src/extend_selection.rs | |||
@@ -47,11 +47,11 @@ mod tests { | |||
47 | let (analysis, frange) = single_file_with_range( | 47 | let (analysis, frange) = single_file_with_range( |
48 | " | 48 | " |
49 | fn main() { | 49 | fn main() { |
50 | ctry!(foo(|x| <|>x<|>)); | 50 | vec![foo(|x| <|>x<|>)]; |
51 | } | 51 | } |
52 | ", | 52 | ", |
53 | ); | 53 | ); |
54 | let r = analysis.extend_selection(frange).unwrap(); | 54 | let r = analysis.extend_selection(frange).unwrap(); |
55 | assert_eq!(r, TextRange::from_to(51.into(), 56.into())); | 55 | assert_eq!(r, TextRange::from_to(50.into(), 55.into())); |
56 | } | 56 | } |
57 | } | 57 | } |
diff --git a/crates/ra_ide_api/src/snapshots/tests__highlight_query_group_macro.snap b/crates/ra_ide_api/src/snapshots/tests__highlight_query_group_macro.snap index 062add083..0b802ac3d 100644 --- a/crates/ra_ide_api/src/snapshots/tests__highlight_query_group_macro.snap +++ b/crates/ra_ide_api/src/snapshots/tests__highlight_query_group_macro.snap | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:01.017117100+00:00" | 2 | created: "2019-02-01T07:52:15.689836752+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.3 |
4 | expression: "&highlights" | 4 | expression: "&highlights" |
5 | source: "crates\\ra_ide_api\\src\\syntax_highlighting.rs" | 5 | source: crates/ra_ide_api/src/syntax_highlighting.rs |
6 | --- | 6 | --- |
7 | [ | 7 | [ |
8 | HighlightedRange { | 8 | HighlightedRange { |
diff --git a/crates/ra_ide_api/src/snapshots/tests__highlights_code_inside_macros.snap b/crates/ra_ide_api/src/snapshots/tests__highlights_code_inside_macros.snap index fd8265abb..ae8923e75 100644 --- a/crates/ra_ide_api/src/snapshots/tests__highlights_code_inside_macros.snap +++ b/crates/ra_ide_api/src/snapshots/tests__highlights_code_inside_macros.snap | |||
@@ -1,8 +1,8 @@ | |||
1 | --- | 1 | --- |
2 | created: "2019-01-22T14:45:01.043047100+00:00" | 2 | created: "2019-02-01T07:46:59.130146403+00:00" |
3 | creator: insta@0.4.0 | 3 | creator: insta@0.5.3 |
4 | expression: "&highlights" | 4 | expression: "&highlights" |
5 | source: "crates\\ra_ide_api\\src\\syntax_highlighting.rs" | 5 | source: crates/ra_ide_api/src/syntax_highlighting.rs |
6 | --- | 6 | --- |
7 | [ | 7 | [ |
8 | HighlightedRange { | 8 | HighlightedRange { |
@@ -14,59 +14,31 @@ source: "crates\\ra_ide_api\\src\\syntax_highlighting.rs" | |||
14 | tag: "function" | 14 | tag: "function" |
15 | }, | 15 | }, |
16 | HighlightedRange { | 16 | HighlightedRange { |
17 | range: [41; 46), | 17 | range: [41; 45), |
18 | tag: "macro" | 18 | tag: "macro" |
19 | }, | 19 | }, |
20 | HighlightedRange { | 20 | HighlightedRange { |
21 | range: [49; 52), | 21 | range: [48; 51), |
22 | tag: "keyword" | 22 | tag: "keyword" |
23 | }, | 23 | }, |
24 | HighlightedRange { | 24 | HighlightedRange { |
25 | range: [57; 59), | 25 | range: [56; 58), |
26 | tag: "literal" | 26 | tag: "literal" |
27 | }, | 27 | }, |
28 | HighlightedRange { | 28 | HighlightedRange { |
29 | range: [82; 86), | 29 | range: [48; 51), |
30 | tag: "macro" | ||
31 | }, | ||
32 | HighlightedRange { | ||
33 | range: [89; 92), | ||
34 | tag: "keyword" | ||
35 | }, | ||
36 | HighlightedRange { | ||
37 | range: [97; 99), | ||
38 | tag: "literal" | ||
39 | }, | ||
40 | HighlightedRange { | ||
41 | range: [49; 52), | ||
42 | tag: "keyword" | ||
43 | }, | ||
44 | HighlightedRange { | ||
45 | range: [53; 54), | ||
46 | tag: "function" | ||
47 | }, | ||
48 | HighlightedRange { | ||
49 | range: [57; 59), | ||
50 | tag: "literal" | ||
51 | }, | ||
52 | HighlightedRange { | ||
53 | range: [61; 62), | ||
54 | tag: "text" | ||
55 | }, | ||
56 | HighlightedRange { | ||
57 | range: [89; 92), | ||
58 | tag: "keyword" | 30 | tag: "keyword" |
59 | }, | 31 | }, |
60 | HighlightedRange { | 32 | HighlightedRange { |
61 | range: [93; 94), | 33 | range: [52; 53), |
62 | tag: "function" | 34 | tag: "function" |
63 | }, | 35 | }, |
64 | HighlightedRange { | 36 | HighlightedRange { |
65 | range: [97; 99), | 37 | range: [56; 58), |
66 | tag: "literal" | 38 | tag: "literal" |
67 | }, | 39 | }, |
68 | HighlightedRange { | 40 | HighlightedRange { |
69 | range: [101; 102), | 41 | range: [60; 61), |
70 | tag: "text" | 42 | tag: "text" |
71 | } | 43 | } |
72 | ] | 44 | ] |
diff --git a/crates/ra_ide_api/src/syntax_highlighting.rs b/crates/ra_ide_api/src/syntax_highlighting.rs index 26bde495b..6c4391e1e 100644 --- a/crates/ra_ide_api/src/syntax_highlighting.rs +++ b/crates/ra_ide_api/src/syntax_highlighting.rs | |||
@@ -42,7 +42,6 @@ mod tests { | |||
42 | let (analysis, file_id) = single_file( | 42 | let (analysis, file_id) = single_file( |
43 | " | 43 | " |
44 | fn main() { | 44 | fn main() { |
45 | ctry!({ let x = 92; x}); | ||
46 | vec![{ let x = 92; x}]; | 45 | vec![{ let x = 92; x}]; |
47 | } | 46 | } |
48 | ", | 47 | ", |