mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Store #[derive]
attribute ID along macro invoc
This commit is contained in:
parent
546da15972
commit
c0dd36fd42
5 changed files with 22 additions and 12 deletions
|
@ -269,7 +269,7 @@ mod tests {
|
|||
use expect_test::{expect, Expect};
|
||||
use name::AsName;
|
||||
|
||||
use crate::{test_db::TestDB, AstId, MacroCallId, MacroCallKind, MacroCallLoc};
|
||||
use crate::{test_db::TestDB, AstId, AttrId, MacroCallId, MacroCallKind, MacroCallLoc};
|
||||
|
||||
use super::*;
|
||||
|
||||
|
@ -317,7 +317,11 @@ $0
|
|||
local_inner: false,
|
||||
},
|
||||
krate: CrateId(0),
|
||||
kind: MacroCallKind::Derive { ast_id, derive_name: name.to_string() },
|
||||
kind: MacroCallKind::Derive {
|
||||
ast_id,
|
||||
derive_name: name.to_string(),
|
||||
derive_attr: AttrId(0),
|
||||
},
|
||||
};
|
||||
|
||||
let id: MacroCallId = db.intern_macro(loc).into();
|
||||
|
|
|
@ -291,7 +291,7 @@ pub struct MacroCallLoc {
|
|||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum MacroCallKind {
|
||||
FnLike { ast_id: AstId<ast::MacroCall> },
|
||||
Derive { ast_id: AstId<ast::Item>, derive_name: String },
|
||||
Derive { ast_id: AstId<ast::Item>, derive_name: String, derive_attr: AttrId },
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue