Skip to content

Commit

Permalink
[analyzer] Only run requested phases with injected macro impl.
Browse files Browse the repository at this point in the history
[email protected]

Change-Id: Ia735da03cadea14d8aef51dab3d7a3709f8e5269
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/394740
Reviewed-by: Konstantin Shcheglov <[email protected]>
Auto-Submit: Morgan :) <[email protected]>
Commit-Queue: Konstantin Shcheglov <[email protected]>
  • Loading branch information
davidmorgan authored and Commit Queue committed Nov 12, 2024
1 parent 717c523 commit d564729
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/analyzer/lib/src/summary2/macro_application.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 3 additions & 0 deletions pkg/analyzer/lib/src/summary2/macro_injected_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ abstract class MacroRunner {
}

abstract class RunningMacro {
/// The phases the macro runs in.
Future<Set<Phase>> get phasesToExecute;

/// Executes the macro's phase two, declarations.
Future<MacroExecutionResult> executeDeclarationsPhase(MacroTarget target,
DeclarationPhaseIntrospector declarationsPhaseIntrospector);
Expand Down

0 comments on commit d564729

Please sign in to comment.