Initial Attempt limiting number of token tree in macro expansion.

This commit is contained in:
Wyatt Herkamp 2024-03-14 08:52:13 -04:00
parent 83f9cc677f
commit 15d183be79
5 changed files with 120 additions and 46 deletions

View file

@ -972,7 +972,8 @@ fn precise_macro_call_location(
MacroKind::ProcMacro,
)
}
MacroCallKind::Derive { ast_id, derive_attr_index, derive_index } => {
// TODO: derive_macro_id
MacroCallKind::Derive { ast_id, derive_attr_index, derive_index, derive_macro_id } => {
let node = ast_id.to_node(db.upcast());
// Compute the precise location of the macro name's token in the derive
// list.
@ -3709,7 +3710,8 @@ impl Impl {
let macro_file = src.file_id.macro_file()?;
let loc = macro_file.macro_call_id.lookup(db.upcast());
let (derive_attr, derive_index) = match loc.kind {
MacroCallKind::Derive { ast_id, derive_attr_index, derive_index } => {
// TODO: derive_macro_id
MacroCallKind::Derive { ast_id, derive_attr_index, derive_index, derive_macro_id } => {
let module_id = self.id.lookup(db.upcast()).container;
(
db.crate_def_map(module_id.krate())[module_id.local_id]