aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/ast
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src/ast')
-rw-r--r--crates/ra_syntax/src/ast/extensions.rs4
-rw-r--r--crates/ra_syntax/src/ast/generated.rs1
-rw-r--r--crates/ra_syntax/src/ast/traits.rs7
3 files changed, 4 insertions, 8 deletions
diff --git a/crates/ra_syntax/src/ast/extensions.rs b/crates/ra_syntax/src/ast/extensions.rs
index a8f625176..baaef3023 100644
--- a/crates/ra_syntax/src/ast/extensions.rs
+++ b/crates/ra_syntax/src/ast/extensions.rs
@@ -221,6 +221,10 @@ impl ast::FnDef {
221 .and_then(|it| it.into_token()) 221 .and_then(|it| it.into_token())
222 .filter(|it| it.kind() == T![;]) 222 .filter(|it| it.kind() == T![;])
223 } 223 }
224
225 pub fn is_async(&self) -> bool {
226 self.syntax().children_with_tokens().any(|it| it.kind() == T![async])
227 }
224} 228}
225 229
226impl ast::LetStmt { 230impl ast::LetStmt {
diff --git a/crates/ra_syntax/src/ast/generated.rs b/crates/ra_syntax/src/ast/generated.rs
index 73e1c407c..9f9d6e63c 100644
--- a/crates/ra_syntax/src/ast/generated.rs
+++ b/crates/ra_syntax/src/ast/generated.rs
@@ -1129,7 +1129,6 @@ impl ast::NameOwner for FnDef {}
1129impl ast::TypeParamsOwner for FnDef {} 1129impl ast::TypeParamsOwner for FnDef {}
1130impl ast::AttrsOwner for FnDef {} 1130impl ast::AttrsOwner for FnDef {}
1131impl ast::DocCommentsOwner for FnDef {} 1131impl ast::DocCommentsOwner for FnDef {}
1132impl ast::AsyncOwner for FnDef {}
1133impl FnDef { 1132impl FnDef {
1134 pub fn param_list(&self) -> Option<ParamList> { 1133 pub fn param_list(&self) -> Option<ParamList> {
1135 AstChildren::new(&self.syntax).next() 1134 AstChildren::new(&self.syntax).next()
diff --git a/crates/ra_syntax/src/ast/traits.rs b/crates/ra_syntax/src/ast/traits.rs
index 8bf6aa2f0..f99984fe0 100644
--- a/crates/ra_syntax/src/ast/traits.rs
+++ b/crates/ra_syntax/src/ast/traits.rs
@@ -8,7 +8,6 @@ use crate::{
8 ast::{self, child_opt, children, AstChildren, AstNode, AstToken}, 8 ast::{self, child_opt, children, AstChildren, AstNode, AstToken},
9 match_ast, 9 match_ast,
10 syntax_node::{SyntaxElementChildren, SyntaxNodeChildren}, 10 syntax_node::{SyntaxElementChildren, SyntaxNodeChildren},
11 SyntaxKind,
12}; 11};
13 12
14pub trait TypeAscriptionOwner: AstNode { 13pub trait TypeAscriptionOwner: AstNode {
@@ -106,12 +105,6 @@ pub trait AttrsOwner: AstNode {
106 } 105 }
107} 106}
108 107
109pub trait AsyncOwner: AstNode {
110 fn is_async(&self) -> bool {
111 self.syntax().children_with_tokens().any(|t| t.kind() == SyntaxKind::ASYNC_KW)
112 }
113}
114
115pub trait DocCommentsOwner: AstNode { 108pub trait DocCommentsOwner: AstNode {
116 fn doc_comments(&self) -> CommentIter { 109 fn doc_comments(&self) -> CommentIter {
117 CommentIter { iter: self.syntax().children_with_tokens() } 110 CommentIter { iter: self.syntax().children_with_tokens() }