diff options
author | AdnoC <[email protected]> | 2020-12-30 05:46:34 +0000 |
---|---|---|
committer | AdnoC <[email protected]> | 2020-12-30 05:46:34 +0000 |
commit | 6eeec5d75f0757c341440198fde90c3363226307 (patch) | |
tree | 79b16b1d1b3b6a8c2c1be074e8d9f6083ffec2e4 /crates/syntax | |
parent | 848e817f603ed12e065bc3057d12e04b481fb5bb (diff) |
Smarter bracketed use diagnostic
Diffstat (limited to 'crates/syntax')
-rw-r--r-- | crates/syntax/src/ast/node_ext.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index c45cb514a..8a8c2319b 100644 --- a/crates/syntax/src/ast/node_ext.rs +++ b/crates/syntax/src/ast/node_ext.rs | |||
@@ -193,6 +193,14 @@ impl ast::UseTreeList { | |||
193 | .and_then(ast::UseTree::cast) | 193 | .and_then(ast::UseTree::cast) |
194 | .expect("UseTreeLists are always nested in UseTrees") | 194 | .expect("UseTreeLists are always nested in UseTrees") |
195 | } | 195 | } |
196 | |||
197 | pub fn has_inner_comment(&self) -> bool { | ||
198 | self.syntax() | ||
199 | .children_with_tokens() | ||
200 | .filter_map(|it| it.into_token()) | ||
201 | .find_map(ast::Comment::cast) | ||
202 | .is_some() | ||
203 | } | ||
196 | } | 204 | } |
197 | 205 | ||
198 | impl ast::Impl { | 206 | impl ast::Impl { |