Smarter bracketed use diagnostic

This commit is contained in:
AdnoC 2020-12-29 22:46:34 -07:00
parent 848e817f60
commit 6eeec5d75f
2 changed files with 14 additions and 0 deletions

View file

@ -193,6 +193,14 @@ impl ast::UseTreeList {
.and_then(ast::UseTree::cast)
.expect("UseTreeLists are always nested in UseTrees")
}
pub fn has_inner_comment(&self) -> bool {
self.syntax()
.children_with_tokens()
.filter_map(|it| it.into_token())
.find_map(ast::Comment::cast)
.is_some()
}
}
impl ast::Impl {