mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Initial Attempt limiting number of token tree in macro expansion.
This commit is contained in:
parent
83f9cc677f
commit
15d183be79
5 changed files with 120 additions and 46 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue