@@ -21,8 +21,8 @@ use crate::{
21
21
span_map:: { RealSpanMap , SpanMap , SpanMapRef } ,
22
22
tt, AstId , BuiltinAttrExpander , BuiltinDeriveExpander , BuiltinFnLikeExpander ,
23
23
CustomProcMacroExpander , EagerCallInfo , ExpandError , ExpandResult , ExpandTo , ExpansionSpanMap ,
24
- HirFileId , HirFileIdRepr , MacroCallId , MacroCallKind , MacroCallLoc , MacroDefId , MacroDefKind ,
25
- MacroFileId ,
24
+ HirFileId , HirFileIdRepr , Lookup , MacroCallId , MacroCallKind , MacroCallLoc , MacroDefId ,
25
+ MacroDefKind , MacroFileId ,
26
26
} ;
27
27
/// This is just to ensure the types of smart_macro_arg and macro_arg are the same
28
28
type MacroArgResult = ( Arc < tt:: Subtree > , SyntaxFixupUndoInfo , Span ) ;
@@ -99,6 +99,7 @@ pub trait ExpandDatabase: SourceDatabase {
99
99
/// Lowers syntactic macro call to a token tree representation. That's a firewall
100
100
/// query, only typing in the macro call itself changes the returned
101
101
/// subtree.
102
+ #[ deprecated = "calling this is incorrect, call `macro_arg_considering_derives` instead" ]
102
103
fn macro_arg ( & self , id : MacroCallId ) -> MacroArgResult ;
103
104
#[ salsa:: transparent]
104
105
fn macro_arg_considering_derives (
@@ -140,7 +141,11 @@ pub trait ExpandDatabase: SourceDatabase {
140
141
fn syntax_context ( db : & dyn ExpandDatabase , file : HirFileId ) -> SyntaxContextId {
141
142
match file. repr ( ) {
142
143
HirFileIdRepr :: FileId ( _) => SyntaxContextId :: ROOT ,
143
- HirFileIdRepr :: MacroFile ( m) => db. macro_arg ( m. macro_call_id ) . 2 . ctx ,
144
+ HirFileIdRepr :: MacroFile ( m) => {
145
+ db. macro_arg_considering_derives ( m. macro_call_id , & m. macro_call_id . lookup ( db) . kind )
146
+ . 2
147
+ . ctx
148
+ }
144
149
}
145
150
}
146
151
@@ -393,6 +398,7 @@ pub(crate) fn parse_with_map(
393
398
/// Other wise return the [macro_arg] for the macro_call_id.
394
399
///
395
400
/// This is not connected to the database so it does not cached the result. However, the inner [macro_arg] query is
401
+ #[ allow( deprecated) ] // we are macro_arg_considering_derives
396
402
fn macro_arg_considering_derives (
397
403
db : & dyn ExpandDatabase ,
398
404
id : MacroCallId ,
0 commit comments