aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-05-28 15:34:28 +0100
committerAleksey Kladov <[email protected]>2019-05-28 15:34:28 +0100
commit0efbcdf43544af471a935c790ae99e2a9b5516c3 (patch)
tree4d9d65e4888cacf5fd7fbc359233afb8fe5395ad /crates/ra_syntax/src/ast.rs
parent310bfe57bd1ea3cd5e22d434ae9d709265af5463 (diff)
remove old parsing methods
Diffstat (limited to 'crates/ra_syntax/src/ast.rs')
-rw-r--r--crates/ra_syntax/src/ast.rs16
1 files changed, 12 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/ast.rs b/crates/ra_syntax/src/ast.rs
index f7e33366e..319110b6a 100644
--- a/crates/ra_syntax/src/ast.rs
+++ b/crates/ra_syntax/src/ast.rs
@@ -80,7 +80,9 @@ fn test_doc_comment_none() {
80 // non-doc 80 // non-doc
81 mod foo {} 81 mod foo {}
82 "#, 82 "#,
83 ); 83 )
84 .ok()
85 .unwrap();
84 let module = file.syntax().descendants().find_map(Module::cast).unwrap(); 86 let module = file.syntax().descendants().find_map(Module::cast).unwrap();
85 assert!(module.doc_comment_text().is_none()); 87 assert!(module.doc_comment_text().is_none());
86} 88}
@@ -93,7 +95,9 @@ fn test_doc_comment_of_items() {
93 // non-doc 95 // non-doc
94 mod foo {} 96 mod foo {}
95 "#, 97 "#,
96 ); 98 )
99 .ok()
100 .unwrap();
97 let module = file.syntax().descendants().find_map(Module::cast).unwrap(); 101 let module = file.syntax().descendants().find_map(Module::cast).unwrap();
98 assert_eq!("doc", module.doc_comment_text().unwrap()); 102 assert_eq!("doc", module.doc_comment_text().unwrap());
99} 103}
@@ -110,7 +114,9 @@ fn test_doc_comment_preserves_indents() {
110 /// ``` 114 /// ```
111 mod foo {} 115 mod foo {}
112 "#, 116 "#,
113 ); 117 )
118 .ok()
119 .unwrap();
114 let module = file.syntax().descendants().find_map(Module::cast).unwrap(); 120 let module = file.syntax().descendants().find_map(Module::cast).unwrap();
115 assert_eq!("doc1\n```\nfn foo() {\n // ...\n}\n```", module.doc_comment_text().unwrap()); 121 assert_eq!("doc1\n```\nfn foo() {\n // ...\n}\n```", module.doc_comment_text().unwrap());
116} 122}
@@ -133,7 +139,9 @@ where
133 for<'a> F: Fn(&'a str) 139 for<'a> F: Fn(&'a str)
134{} 140{}
135 "#, 141 "#,
136 ); 142 )
143 .ok()
144 .unwrap();
137 let where_clause = file.syntax().descendants().find_map(WhereClause::cast).unwrap(); 145 let where_clause = file.syntax().descendants().find_map(WhereClause::cast).unwrap();
138 146
139 let mut predicates = where_clause.predicates(); 147 let mut predicates = where_clause.predicates();