We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0b52e5 commit db15176Copy full SHA for db15176
crates/ra_ide/src/display/structure.rs
@@ -151,10 +151,24 @@ fn structure_node(node: &SyntaxNode) -> Option<StructureNode> {
151
Some(node)
152
},
153
ast::MacroCall(it) => {
154
- let first_token = it.syntax().first_token().unwrap();
155
- if first_token.text().as_str() != "macro_rules" {
156
- return None;
+ let macro_name = it.syntax()
+ .children()
+ .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
+ }
170
}
171
172
decl(it)
173
174
_ => None,
0 commit comments