mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Add expansion infrastructure for derive macros
This commit is contained in:
parent
4c0bd068da
commit
18f6a995d0
18 changed files with 319 additions and 79 deletions
|
@ -152,9 +152,9 @@ impl FromSource for MacroDef {
|
|||
|
||||
let module_src = ModuleSource::from_child_node(db, src.as_ref().map(|it| it.syntax()));
|
||||
let module = Module::from_definition(db, InFile::new(src.file_id, module_src))?;
|
||||
let krate = module.krate().crate_id();
|
||||
let krate = Some(module.krate().crate_id());
|
||||
|
||||
let ast_id = AstId::new(src.file_id, db.ast_id_map(src.file_id).ast_id(&src.value));
|
||||
let ast_id = Some(AstId::new(src.file_id, db.ast_id_map(src.file_id).ast_id(&src.value)));
|
||||
|
||||
let id: MacroDefId = MacroDefId { krate, ast_id, kind };
|
||||
Some(MacroDef { id })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue