mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 11:59:49 +00:00
Don't store call-site text offsets in hygiene info
This commit is contained in:
parent
b37b709459
commit
976a3226fe
19 changed files with 145 additions and 93 deletions
|
@ -204,7 +204,8 @@ impl SourceAnalyzer {
|
|||
macro_call: InFile<&ast::MacroCall>,
|
||||
) -> Option<MacroDef> {
|
||||
let ctx = body::LowerCtx::new(db.upcast(), macro_call.file_id);
|
||||
let path = macro_call.value.path().and_then(|ast| Path::from_src(ast, &ctx))?;
|
||||
let path =
|
||||
macro_call.value.path().and_then(|ast| Path::from_src(db.upcast(), ast, &ctx))?;
|
||||
self.resolver.resolve_path_as_macro(db.upcast(), path.mod_path()).map(|it| it.into())
|
||||
}
|
||||
|
||||
|
@ -283,8 +284,8 @@ impl SourceAnalyzer {
|
|||
|
||||
// This must be a normal source file rather than macro file.
|
||||
let hygiene = Hygiene::new(db.upcast(), self.file_id);
|
||||
let ctx = body::LowerCtx::with_hygiene(&hygiene);
|
||||
let hir_path = Path::from_src(path.clone(), &ctx)?;
|
||||
let ctx = body::LowerCtx::with_hygiene(db.upcast(), &hygiene);
|
||||
let hir_path = Path::from_src(db.upcast(), path.clone(), &ctx)?;
|
||||
|
||||
// Case where path is a qualifier of another path, e.g. foo::bar::Baz where we
|
||||
// trying to resolve foo::bar.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue