Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/highlight_related.rs')
-rw-r--r--crates/ide/src/highlight_related.rs18
1 files changed, 13 insertions, 5 deletions
diff --git a/crates/ide/src/highlight_related.rs b/crates/ide/src/highlight_related.rs
index 065c3f2452..b1efd90d4e 100644
--- a/crates/ide/src/highlight_related.rs
+++ b/crates/ide/src/highlight_related.rs
@@ -575,12 +575,20 @@ impl<'a> WalkExpandedExprCtx<'a> {
}
if let ast::Expr::MacroExpr(expr) = expr {
- if let Some(expanded) = expr
- .macro_call()
- .and_then(|call| self.sema.expand(&call))
- .and_then(ast::MacroStmts::cast)
+ if let Some(expanded) =
+ expr.macro_call().and_then(|call| self.sema.expand(&call))
{
- self.handle_expanded(expanded, cb);
+ match_ast! {
+ match expanded {
+ ast::MacroStmts(it) => {
+ self.handle_expanded(it, cb);
+ },
+ ast::Expr(it) => {
+ self.walk(&it, cb);
+ },
+ _ => {}
+ }
+ }
}
}
}