mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-15 22:54:00 +00:00
fix: ensure that highlight_related works for macro_expr
This commit is contained in:
parent
ae6e8d56d4
commit
d94dcfa841
2 changed files with 13 additions and 6 deletions
|
@ -14,7 +14,6 @@ use ide_db::{
|
|||
FileId, RootDatabase,
|
||||
};
|
||||
use itertools::Itertools;
|
||||
use span::FileRange;
|
||||
use syntax::{
|
||||
ast::{self, HasLoopBody, Label},
|
||||
match_ast, AstNode, AstToken,
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue