diff options
-rw-r--r-- | crates/ra_ide/src/display/structure.rs | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/crates/ra_ide/src/display/structure.rs b/crates/ra_ide/src/display/structure.rs index a80d65ac7..be21fa913 100644 --- a/crates/ra_ide/src/display/structure.rs +++ b/crates/ra_ide/src/display/structure.rs | |||
@@ -151,10 +151,24 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> { | |||
151 | Some(node) | 151 | Some(node) |
152 | }, | 152 | }, |
153 | ast::MacroCall(it) => { | 153 | ast::MacroCall(it) => { |
154 | let first_token = it.syntax().first_token().unwrap(); | 154 | let macro_name = it.syntax() |
155 | if first_token.text().as_str() != "macro_rules" { | 155 | .children() |
156 | return None; | 156 | .find(|c| |
157 | ![ | ||
158 | SyntaxKind::COMMENT, | ||
159 | SyntaxKind::WHITESPACE, | ||
160 | SyntaxKind::ATTR | ||
161 | ].iter() | ||
162 | .any(|&k| k == c.kind()) | ||
163 | ); | ||
164 | |||
165 | match macro_name { | ||
166 | None => return None, | ||
167 | Some(n) => if n.first_token().unwrap().text().as_str() != "macro_rules" { | ||
168 | return None; | ||
169 | } | ||
157 | } | 170 | } |
171 | |||
158 | decl(it) | 172 | decl(it) |
159 | }, | 173 | }, |
160 | _ => None, | 174 | _ => None, |