@@ -54,11 +54,12 @@ use hir_def::{
54
54
per_ns:: PerNs ,
55
55
resolver:: { HasResolver , Resolver } ,
56
56
type_ref:: TypesSourceMap ,
57
- AssocItemId , AssocItemLoc , AttrDefId , CallableDefId , ConstId , ConstParamId , CrateRootModuleId ,
58
- DefWithBodyId , EnumId , EnumVariantId , ExternCrateId , FunctionId , GenericDefId , GenericParamId ,
59
- HasModule , ImplId , InTypeConstId , ItemContainerId , LifetimeParamId , LocalFieldId , Lookup ,
60
- MacroExpander , ModuleId , StaticId , StructId , SyntheticSyntax , TraitAliasId , TraitId , TupleId ,
61
- TypeAliasId , TypeOrConstParamId , TypeParamId , UnionId ,
57
+ AdtId , AssocItemId , AssocItemLoc , AttrDefId , CallableDefId , ConstId , ConstParamId ,
58
+ CrateRootModuleId , DefWithBodyId , EnumId , EnumVariantId , ExternCrateId , FunctionId ,
59
+ GenericDefId , GenericParamId , HasModule , ImplId , InTypeConstId , ItemContainerId ,
60
+ LifetimeParamId , LocalFieldId , Lookup , MacroExpander , MacroId , ModuleId , StaticId , StructId ,
61
+ SyntheticSyntax , TraitAliasId , TraitId , TupleId , TypeAliasId , TypeOrConstParamId , TypeParamId ,
62
+ UnionId ,
62
63
} ;
63
64
use hir_expand:: {
64
65
attrs:: collect_attrs, proc_macro:: ProcMacroKind , AstId , MacroCallKind , RenderedExpandError ,
@@ -127,7 +128,7 @@ pub use {
127
128
ImportPathConfig ,
128
129
// FIXME: This is here since some queries take it as input that are used
129
130
// outside of hir.
130
- { AdtId , MacroId , ModuleDefId } ,
131
+ ModuleDefId ,
131
132
} ,
132
133
hir_expand:: {
133
134
attrs:: { Attr , AttrId } ,
@@ -3000,6 +3001,10 @@ impl Macro {
3000
3001
matches ! ( self . id, MacroId :: MacroRulesId ( id) if db. macro_rules_data( id) . macro_export)
3001
3002
}
3002
3003
3004
+ pub fn is_proc_macro ( self ) -> bool {
3005
+ matches ! ( self . id, MacroId :: ProcMacroId ( _) )
3006
+ }
3007
+
3003
3008
pub fn kind ( & self , db : & dyn HirDatabase ) -> MacroKind {
3004
3009
match self . id {
3005
3010
MacroId :: Macro2Id ( it) => match it. lookup ( db. upcast ( ) ) . expander {
0 commit comments