aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/syntax_tree.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ide/src/syntax_tree.rs')
-rw-r--r--crates/ide/src/syntax_tree.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/crates/ide/src/syntax_tree.rs b/crates/ide/src/syntax_tree.rs
index f80044959..0eed2dbd7 100644
--- a/crates/ide/src/syntax_tree.rs
+++ b/crates/ide/src/syntax_tree.rs
@@ -104,12 +104,12 @@ fn syntax_tree_for_token(node: &SyntaxToken, text_range: TextRange) -> Option<St
104mod tests { 104mod tests {
105 use test_utils::assert_eq_text; 105 use test_utils::assert_eq_text;
106 106
107 use crate::mock_analysis::{analysis_and_range, single_file}; 107 use crate::fixture;
108 108
109 #[test] 109 #[test]
110 fn test_syntax_tree_without_range() { 110 fn test_syntax_tree_without_range() {
111 // Basic syntax 111 // Basic syntax
112 let (analysis, file_id) = single_file(r#"fn foo() {}"#); 112 let (analysis, file_id) = fixture::file(r#"fn foo() {}"#);
113 let syn = analysis.syntax_tree(file_id, None).unwrap(); 113 let syn = analysis.syntax_tree(file_id, None).unwrap();
114 114
115 assert_eq_text!( 115 assert_eq_text!(
@@ -132,7 +132,7 @@ [email protected]
132 .trim() 132 .trim()
133 ); 133 );
134 134
135 let (analysis, file_id) = single_file( 135 let (analysis, file_id) = fixture::file(
136 r#" 136 r#"
137fn test() { 137fn test() {
138 assert!(" 138 assert!("
@@ -184,7 +184,7 @@ [email protected]
184 184
185 #[test] 185 #[test]
186 fn test_syntax_tree_with_range() { 186 fn test_syntax_tree_with_range() {
187 let (analysis, range) = analysis_and_range(r#"<|>fn foo() {}<|>"#.trim()); 187 let (analysis, range) = fixture::range(r#"<|>fn foo() {}<|>"#.trim());
188 let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap(); 188 let syn = analysis.syntax_tree(range.file_id, Some(range.range)).unwrap();
189 189
190 assert_eq_text!( 190 assert_eq_text!(
@@ -206,7 +206,7 @@ [email protected]
206 .trim() 206 .trim()
207 ); 207 );
208 208
209 let (analysis, range) = analysis_and_range( 209 let (analysis, range) = fixture::range(
210 r#"fn test() { 210 r#"fn test() {
211 <|>assert!(" 211 <|>assert!("
212 fn foo() { 212 fn foo() {
@@ -242,7 +242,7 @@ [email protected]
242 242
243 #[test] 243 #[test]
244 fn test_syntax_tree_inside_string() { 244 fn test_syntax_tree_inside_string() {
245 let (analysis, range) = analysis_and_range( 245 let (analysis, range) = fixture::range(
246 r#"fn test() { 246 r#"fn test() {
247 assert!(" 247 assert!("
248<|>fn foo() { 248<|>fn foo() {
@@ -276,7 +276,7 @@ [email protected]
276 ); 276 );
277 277
278 // With a raw string 278 // With a raw string
279 let (analysis, range) = analysis_and_range( 279 let (analysis, range) = fixture::range(
280 r###"fn test() { 280 r###"fn test() {
281 assert!(r#" 281 assert!(r#"
282<|>fn foo() { 282<|>fn foo() {
@@ -310,7 +310,7 @@ [email protected]
310 ); 310 );
311 311
312 // With a raw string 312 // With a raw string
313 let (analysis, range) = analysis_and_range( 313 let (analysis, range) = fixture::range(
314 r###"fn test() { 314 r###"fn test() {
315 assert!(r<|>#" 315 assert!(r<|>#"
316fn foo() { 316fn foo() {