mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
Remove AsyncOwner
This commit is contained in:
parent
42813126d9
commit
208ad97fdc
5 changed files with 6 additions and 13 deletions
|
@ -6,9 +6,7 @@ use hir_expand::{
|
||||||
name::{name, AsName, Name},
|
name::{name, AsName, Name},
|
||||||
AstId, InFile,
|
AstId, InFile,
|
||||||
};
|
};
|
||||||
use ra_syntax::ast::{
|
use ra_syntax::ast::{self, AstNode, ImplItem, ModuleItemOwner, NameOwner, TypeAscriptionOwner};
|
||||||
self, AstNode, AsyncOwner, ImplItem, ModuleItemOwner, NameOwner, TypeAscriptionOwner,
|
|
||||||
};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
db::DefDatabase,
|
db::DefDatabase,
|
||||||
|
|
|
@ -221,6 +221,10 @@ impl ast::FnDef {
|
||||||
.and_then(|it| it.into_token())
|
.and_then(|it| it.into_token())
|
||||||
.filter(|it| it.kind() == T![;])
|
.filter(|it| it.kind() == T![;])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_async(&self) -> bool {
|
||||||
|
self.syntax().children_with_tokens().any(|it| it.kind() == T![async])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ast::LetStmt {
|
impl ast::LetStmt {
|
||||||
|
|
|
@ -1129,7 +1129,6 @@ impl ast::NameOwner for FnDef {}
|
||||||
impl ast::TypeParamsOwner for FnDef {}
|
impl ast::TypeParamsOwner for FnDef {}
|
||||||
impl ast::AttrsOwner for FnDef {}
|
impl ast::AttrsOwner for FnDef {}
|
||||||
impl ast::DocCommentsOwner for FnDef {}
|
impl ast::DocCommentsOwner for FnDef {}
|
||||||
impl ast::AsyncOwner for FnDef {}
|
|
||||||
impl FnDef {
|
impl FnDef {
|
||||||
pub fn param_list(&self) -> Option<ParamList> {
|
pub fn param_list(&self) -> Option<ParamList> {
|
||||||
AstChildren::new(&self.syntax).next()
|
AstChildren::new(&self.syntax).next()
|
||||||
|
|
|
@ -8,7 +8,6 @@ use crate::{
|
||||||
ast::{self, child_opt, children, AstChildren, AstNode, AstToken},
|
ast::{self, child_opt, children, AstChildren, AstNode, AstToken},
|
||||||
match_ast,
|
match_ast,
|
||||||
syntax_node::{SyntaxElementChildren, SyntaxNodeChildren},
|
syntax_node::{SyntaxElementChildren, SyntaxNodeChildren},
|
||||||
SyntaxKind,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub trait TypeAscriptionOwner: AstNode {
|
pub trait TypeAscriptionOwner: AstNode {
|
||||||
|
@ -106,12 +105,6 @@ pub trait AttrsOwner: AstNode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait AsyncOwner: AstNode {
|
|
||||||
fn is_async(&self) -> bool {
|
|
||||||
self.syntax().children_with_tokens().any(|t| t.kind() == SyntaxKind::ASYNC_KW)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub trait DocCommentsOwner: AstNode {
|
pub trait DocCommentsOwner: AstNode {
|
||||||
fn doc_comments(&self) -> CommentIter {
|
fn doc_comments(&self) -> CommentIter {
|
||||||
CommentIter { iter: self.syntax().children_with_tokens() }
|
CommentIter { iter: self.syntax().children_with_tokens() }
|
||||||
|
|
|
@ -275,8 +275,7 @@ Grammar(
|
||||||
"NameOwner",
|
"NameOwner",
|
||||||
"TypeParamsOwner",
|
"TypeParamsOwner",
|
||||||
"AttrsOwner",
|
"AttrsOwner",
|
||||||
"DocCommentsOwner",
|
"DocCommentsOwner"
|
||||||
"AsyncOwner"
|
|
||||||
],
|
],
|
||||||
options: [ "ParamList", ["body", "BlockExpr"], "RetType" ],
|
options: [ "ParamList", ["body", "BlockExpr"], "RetType" ],
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue