mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
simplify
This commit is contained in:
parent
98531dc785
commit
9cba67b2ad
5 changed files with 12 additions and 34 deletions
|
@ -10,7 +10,7 @@ use ra_syntax::{
|
|||
};
|
||||
|
||||
use crate::{
|
||||
Path, Name, HirDatabase, Resolver,DefWithBody, Either, HirFileId,
|
||||
Path, Name, HirDatabase, Resolver,DefWithBody, Either, HirFileId, MacroCallLoc,
|
||||
name::AsName,
|
||||
type_ref::{Mutability, TypeRef},
|
||||
};
|
||||
|
@ -828,7 +828,8 @@ where
|
|||
.ast_id(e)
|
||||
.with_file_id(self.current_file_id);
|
||||
|
||||
if let Some(call_id) = self.resolver.resolve_macro_call(self.db, path, ast_id) {
|
||||
if let Some(def) = self.resolver.resolve_macro_call(path) {
|
||||
let call_id = MacroCallLoc { def, ast_id }.id(self.db);
|
||||
if let Some(tt) = self.db.macro_expand(call_id).ok() {
|
||||
if let Some(expr) = mbe::token_tree_to_expr(&tt).ok() {
|
||||
log::debug!("macro expansion {}", expr.syntax().debug_dump());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue