mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Sourcify some things
If we want to support macros properly, we need to get rid of those FileIds everywhere...
This commit is contained in:
parent
1889b3c7b5
commit
4c90b7e2ec
6 changed files with 22 additions and 21 deletions
|
@ -196,9 +196,8 @@ where
|
|||
N: AstNode,
|
||||
DEF: AstItemDef<N>,
|
||||
{
|
||||
let module_src =
|
||||
crate::ModuleSource::from_child_node(db, src.file_id.original_file(db), &src.ast.syntax());
|
||||
let module = Module::from_definition(db, Source { file_id: src.file_id, ast: module_src })?;
|
||||
let module_src = ModuleSource::from_child_node(db, src.as_ref().map(|it| it.syntax()));
|
||||
let module = Module::from_definition(db, Source::new(src.file_id, module_src))?;
|
||||
let ctx = LocationCtx::new(db, module.id, src.file_id);
|
||||
Some(DEF::from_ast(ctx, &src.ast))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue