mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 22:31:43 +00:00
parent
4e50efcfc5
commit
3f6dc20d3c
8 changed files with 225 additions and 25 deletions
|
@ -167,6 +167,20 @@ impl ast::UseTreeList {
|
|||
.and_then(ast::UseTree::cast)
|
||||
.expect("UseTreeLists are always nested in UseTrees")
|
||||
}
|
||||
pub fn l_curly(&self) -> Option<SyntaxToken> {
|
||||
self.token(T!['{'])
|
||||
}
|
||||
|
||||
pub fn r_curly(&self) -> Option<SyntaxToken> {
|
||||
self.token(T!['}'])
|
||||
}
|
||||
|
||||
fn token(&self, kind: SyntaxKind) -> Option<SyntaxToken> {
|
||||
self.syntax()
|
||||
.children_with_tokens()
|
||||
.filter_map(|it| it.into_token())
|
||||
.find(|it| it.kind() == kind)
|
||||
}
|
||||
}
|
||||
|
||||
impl ast::ImplDef {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue