Skip to content

Commit

Permalink
Resolve merge
Browse files Browse the repository at this point in the history
  • Loading branch information
martinothamar committed Nov 17, 2022
2 parents 12010a3 + 2f3b3d8 commit 726ddba
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
12 changes: 7 additions & 5 deletions src/Mediator.SourceGenerator.Roslyn38/MediatorGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ namespace Mediator.SourceGenerator;
[Generator]
public sealed class MediatorGenerator : ISourceGenerator
{
internal CompilationAnalyzer? CompilationAnalyzer { get; private set; }
internal CompilationAnalyzer? CompilationAnalyzer;

public void Execute(GeneratorExecutionContext context)
{
Expand Down Expand Up @@ -33,13 +33,15 @@ private void ExecuteInternal(in GeneratorExecutionContext context)
context.CancellationToken
);

CompilationAnalyzer = new CompilationAnalyzer(in analyzerContext);
var compilationAnalyzer = new CompilationAnalyzer(in analyzerContext);

CompilationAnalyzer.Initialize();
CompilationAnalyzer.Analyze();
compilationAnalyzer.Initialize();
compilationAnalyzer.Analyze();

CompilationAnalyzer = compilationAnalyzer;

var mediatorImplementationGenerator = new MediatorImplementationGenerator();
mediatorImplementationGenerator.Generate(CompilationAnalyzer);
mediatorImplementationGenerator.Generate(compilationAnalyzer);
}

public void Initialize(GeneratorInitializationContext context)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace Mediator.SourceGenerator;
[Generator]
public sealed class IncrementalMediatorGenerator : IIncrementalGenerator
{
internal CompilationAnalyzer? CompilationAnalyzer { get; private set; }
internal CompilationAnalyzer? CompilationAnalyzer;

private void ExecuteInternal(
in SourceProductionContext context,
Expand All @@ -24,19 +24,21 @@ IReadOnlyList<InvocationExpressionSyntax> addMediatorCalls
context.CancellationToken
);

CompilationAnalyzer = new CompilationAnalyzer(in analyzerContext);
var compilationAnalyzer = new CompilationAnalyzer(in analyzerContext);

CompilationAnalyzer.Initialize();
CompilationAnalyzer.Analyze();
compilationAnalyzer.Initialize();
compilationAnalyzer.Analyze();

CompilationAnalyzer = compilationAnalyzer;

var mediatorImplementationGenerator = new MediatorImplementationGenerator();
mediatorImplementationGenerator.Generate(CompilationAnalyzer);
mediatorImplementationGenerator.Generate(compilationAnalyzer);
}

public void Initialize(IncrementalGeneratorInitializationContext context)
{
context.RegisterPostInitializationOutput(
context =>
static context =>
{
var generatorVersion = Versioning.GetVersion();
Expand Down
2 changes: 1 addition & 1 deletion version.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
"branchName": "release/v{version}",
"firstUnstableTag": "preview"
}
}
}

0 comments on commit 726ddba

Please sign in to comment.