diff options
Diffstat (limited to 'crates/syntax')
-rw-r--r-- | crates/syntax/Cargo.toml | 2 | ||||
-rw-r--r-- | crates/syntax/src/ast/node_ext.rs | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/crates/syntax/Cargo.toml b/crates/syntax/Cargo.toml index 21015591c..5d8389ade 100644 --- a/crates/syntax/Cargo.toml +++ b/crates/syntax/Cargo.toml | |||
@@ -11,7 +11,7 @@ edition = "2018" | |||
11 | doctest = false | 11 | doctest = false |
12 | 12 | ||
13 | [dependencies] | 13 | [dependencies] |
14 | itertools = "0.9.0" | 14 | itertools = "0.10.0" |
15 | rowan = "0.10.0" | 15 | rowan = "0.10.0" |
16 | rustc_lexer = { version = "695.0.0", package = "rustc-ap-rustc_lexer" } | 16 | rustc_lexer = { version = "695.0.0", package = "rustc-ap-rustc_lexer" } |
17 | rustc-hash = "1.1.0" | 17 | rustc-hash = "1.1.0" |
diff --git a/crates/syntax/src/ast/node_ext.rs b/crates/syntax/src/ast/node_ext.rs index c45cb514a..2aa472fb4 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 { |