diff --git a/pkg/analyzer/lib/src/summary2/macro_application.dart b/pkg/analyzer/lib/src/summary2/macro_application.dart index fb51ed781f3a..412bfb5fdc5d 100644 --- a/pkg/analyzer/lib/src/summary2/macro_application.dart +++ b/pkg/analyzer/lib/src/summary2/macro_application.dart @@ -652,11 +652,7 @@ class LibraryMacroApplier { annotationIndex: annotationIndex, annotationNode: annotation, instance: instance, - phasesToExecute: { - macro.Phase.types, - macro.Phase.declarations, - macro.Phase.definitions - }, + phasesToExecute: await instance.phasesToExecute, ); libraryBuilder._applications.add(application); diff --git a/pkg/analyzer/lib/src/summary2/macro_injected_impl.dart b/pkg/analyzer/lib/src/summary2/macro_injected_impl.dart index 6339a6a71ded..af130c75c2bb 100644 --- a/pkg/analyzer/lib/src/summary2/macro_injected_impl.dart +++ b/pkg/analyzer/lib/src/summary2/macro_injected_impl.dart @@ -35,6 +35,9 @@ abstract class MacroRunner { } abstract class RunningMacro { + /// The phases the macro runs in. + Future> get phasesToExecute; + /// Executes the macro's phase two, declarations. Future executeDeclarationsPhase(MacroTarget target, DeclarationPhaseIntrospector declarationsPhaseIntrospector);