@@ -54,11 +54,12 @@ use hir_def::{
5454 per_ns:: PerNs ,
5555 resolver:: { HasResolver , Resolver } ,
5656 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 ,
6263} ;
6364use hir_expand:: {
6465 attrs:: collect_attrs, proc_macro:: ProcMacroKind , AstId , MacroCallKind , RenderedExpandError ,
@@ -127,7 +128,7 @@ pub use {
127128 ImportPathConfig ,
128129 // FIXME: This is here since some queries take it as input that are used
129130 // outside of hir.
130- { AdtId , MacroId , ModuleDefId } ,
131+ ModuleDefId ,
131132 } ,
132133 hir_expand:: {
133134 attrs:: { Attr , AttrId } ,
@@ -3000,6 +3001,10 @@ impl Macro {
30003001 matches ! ( self . id, MacroId :: MacroRulesId ( id) if db. macro_rules_data( id) . macro_export)
30013002 }
30023003
3004+ pub fn is_proc_macro ( self ) -> bool {
3005+ matches ! ( self . id, MacroId :: ProcMacroId ( _) )
3006+ }
3007+
30033008 pub fn kind ( & self , db : & dyn HirDatabase ) -> MacroKind {
30043009 match self . id {
30053010 MacroId :: Macro2Id ( it) => match it. lookup ( db. upcast ( ) ) . expander {
0 commit comments