mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +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},
|
||||
AstId, InFile,
|
||||
};
|
||||
use ra_syntax::ast::{
|
||||
self, AstNode, AsyncOwner, ImplItem, ModuleItemOwner, NameOwner, TypeAscriptionOwner,
|
||||
};
|
||||
use ra_syntax::ast::{self, AstNode, ImplItem, ModuleItemOwner, NameOwner, TypeAscriptionOwner};
|
||||
|
||||
use crate::{
|
||||
db::DefDatabase,
|
||||
|
|
|
@ -221,6 +221,10 @@ impl ast::FnDef {
|
|||
.and_then(|it| it.into_token())
|
||||
.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 {
|
||||
|
|
|
@ -1129,7 +1129,6 @@ impl ast::NameOwner for FnDef {}
|
|||
impl ast::TypeParamsOwner for FnDef {}
|
||||
impl ast::AttrsOwner for FnDef {}
|
||||
impl ast::DocCommentsOwner for FnDef {}
|
||||
impl ast::AsyncOwner for FnDef {}
|
||||
impl FnDef {
|
||||
pub fn param_list(&self) -> Option<ParamList> {
|
||||
AstChildren::new(&self.syntax).next()
|
||||
|
|
|
@ -8,7 +8,6 @@ use crate::{
|
|||
ast::{self, child_opt, children, AstChildren, AstNode, AstToken},
|
||||
match_ast,
|
||||
syntax_node::{SyntaxElementChildren, SyntaxNodeChildren},
|
||||
SyntaxKind,
|
||||
};
|
||||
|
||||
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 {
|
||||
fn doc_comments(&self) -> CommentIter {
|
||||
CommentIter { iter: self.syntax().children_with_tokens() }
|
||||
|
|
|
@ -275,8 +275,7 @@ Grammar(
|
|||
"NameOwner",
|
||||
"TypeParamsOwner",
|
||||
"AttrsOwner",
|
||||
"DocCommentsOwner",
|
||||
"AsyncOwner"
|
||||
"DocCommentsOwner"
|
||||
],
|
||||
options: [ "ParamList", ["body", "BlockExpr"], "RetType" ],
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue