diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-25 18:32:17 +0100 |
---|---|---|
committer | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-07-25 18:32:17 +0100 |
commit | ceb16591deef2190daaf5eb9a6480f20dc5d169c (patch) | |
tree | 47edb8102902df9e291d5d0c8274ef1388546d03 /crates/ra_ide_api/src/syntax_tree.rs | |
parent | a8e37ddbc8fa666105a5eca8e2dc9f261d8934e8 (diff) | |
parent | dbbb0beb3ec9f11a635f43e60f3b3a42ba61338a (diff) |
Merge #1591
1591: Make Analysis api cancellable r=matklad a=SomeoneToIgnore
Based on the discussion from here: https://github.com/rust-analyzer/rust-analyzer/pull/1549#discussion_r305593236
Co-authored-by: Kirill Bulatov <[email protected]>
Diffstat (limited to 'crates/ra_ide_api/src/syntax_tree.rs')
-rw-r--r-- | crates/ra_ide_api/src/syntax_tree.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/crates/ra_ide_api/src/syntax_tree.rs b/crates/ra_ide_api/src/syntax_tree.rs index a07e670fa..dd31b9093 100644 --- a/crates/ra_ide_api/src/syntax_tree.rs +++ b/crates/ra_ide_api/src/syntax_tree.rs | |||
@@ -101,7 +101,7 @@ mod tests { | |||
101 | fn test_syntax_tree_without_range() { | 101 | fn test_syntax_tree_without_range() { |
102 | // Basic syntax | 102 | // Basic syntax |
103 | let (analysis, file_id) = single_file(r#"fn foo() {}"#); | 103 | let (analysis, file_id) = single_file(r#"fn foo() {}"#); |
104 | let syn = analysis.syntax_tree(file_id, None); | 104 | let syn = analysis.syntax_tree(file_id, None).unwrap(); |
105 | 105 | ||
106 | assert_eq_text!( | 106 | assert_eq_text!( |
107 | syn.trim(), | 107 | syn.trim(), |
@@ -133,7 +133,7 @@ fn test() { | |||
133 | }"# | 133 | }"# |
134 | .trim(), | 134 | .trim(), |
135 | ); | 135 | ); |
136 | let syn = analysis.syntax_tree(file_id, None); | 136 | let syn = analysis.syntax_tree(file_id, None).unwrap(); |
137 | 137 | ||
138 | assert_eq_text!( | 138 | assert_eq_text!( |
139 | syn.trim(), | 139 | syn.trim(), |
@@ -176,7 +176,7 @@ SOURCE_FILE@[0; 60) | |||
176 | #[test] | 176 | #[test] |
177 | fn test_syntax_tree_with_range() { | 177 | fn test_syntax_tree_with_range() { |
178 | let (analysis, range) = single_file_with_range(r#"<|>fn foo() {}<|>"#.trim()); | 178 | let (analysis, range) = single_file_with_range(r#"<|>fn foo() {}<|>"#.trim()); |
179 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 179 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
180 | 180 | ||
181 | assert_eq_text!( | 181 | assert_eq_text!( |
182 | syn.trim(), | 182 | syn.trim(), |
@@ -206,7 +206,7 @@ FN_DEF@[0; 11) | |||
206 | }"# | 206 | }"# |
207 | .trim(), | 207 | .trim(), |
208 | ); | 208 | ); |
209 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 209 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
210 | 210 | ||
211 | assert_eq_text!( | 211 | assert_eq_text!( |
212 | syn.trim(), | 212 | syn.trim(), |
@@ -244,7 +244,7 @@ fn bar() { | |||
244 | }"# | 244 | }"# |
245 | .trim(), | 245 | .trim(), |
246 | ); | 246 | ); |
247 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 247 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
248 | assert_eq_text!( | 248 | assert_eq_text!( |
249 | syn.trim(), | 249 | syn.trim(), |
250 | r#" | 250 | r#" |
@@ -278,7 +278,7 @@ fn bar() { | |||
278 | }"### | 278 | }"### |
279 | .trim(), | 279 | .trim(), |
280 | ); | 280 | ); |
281 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 281 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
282 | assert_eq_text!( | 282 | assert_eq_text!( |
283 | syn.trim(), | 283 | syn.trim(), |
284 | r#" | 284 | r#" |
@@ -311,7 +311,7 @@ fn bar() { | |||
311 | }"### | 311 | }"### |
312 | .trim(), | 312 | .trim(), |
313 | ); | 313 | ); |
314 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)); | 314 | let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); |
315 | assert_eq_text!( | 315 | assert_eq_text!( |
316 | syn.trim(), | 316 | syn.trim(), |
317 | r#" | 317 | r#" |