mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
hir_ty: Expand macros at type position
This commit is contained in:
parent
fb2d284f28
commit
cf3b4f1e20
17 changed files with 434 additions and 81 deletions
|
@ -6,6 +6,7 @@ use std::{cell::RefCell, fmt, iter::successors};
|
|||
|
||||
use base_db::{FileId, FileRange};
|
||||
use hir_def::{
|
||||
body,
|
||||
resolver::{self, HasResolver, Resolver, TypeNs},
|
||||
AsMacroCall, FunctionId, TraitId, VariantId,
|
||||
};
|
||||
|
@ -854,7 +855,8 @@ impl<'a> SemanticsScope<'a> {
|
|||
/// necessary a heuristic, as it doesn't take hygiene into account.
|
||||
pub fn speculative_resolve(&self, path: &ast::Path) -> Option<PathResolution> {
|
||||
let hygiene = Hygiene::new(self.db.upcast(), self.file_id);
|
||||
let path = Path::from_src(path.clone(), &hygiene)?;
|
||||
let ctx = body::LowerCtx::with_hygiene(&hygiene);
|
||||
let path = Path::from_src(path.clone(), &ctx)?;
|
||||
resolve_hir_path(self.db, &self.resolver, &path)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue