diff --git a/src/Dapper.AOT.Analyzers/CodeAnalysis/Abstractions/InterceptorGeneratorBase.cs b/src/Dapper.AOT.Analyzers/CodeAnalysis/Abstractions/InterceptorGeneratorBase.cs index b7caf3ba..e45886f5 100644 --- a/src/Dapper.AOT.Analyzers/CodeAnalysis/Abstractions/InterceptorGeneratorBase.cs +++ b/src/Dapper.AOT.Analyzers/CodeAnalysis/Abstractions/InterceptorGeneratorBase.cs @@ -3,8 +3,7 @@ namespace Dapper.CodeAnalysis.Abstractions { - public abstract class InterceptorGeneratorBase : DiagnosticAnalyzer, IIncrementalGenerator, - ISourceGenerator // for CSharpGeneratorDriver - see Roslyn #69906 + public abstract class InterceptorGeneratorBase : DiagnosticAnalyzer, IIncrementalGenerator { public override void Initialize(AnalysisContext context) { @@ -15,10 +14,5 @@ public override void Initialize(AnalysisContext context) /// public abstract void Initialize(IncrementalGeneratorInitializationContext context); - - // for CSharpGeneratorDriver - see Roslyn #69906 - void ISourceGenerator.Initialize(GeneratorInitializationContext context) { } - // for CSharpGeneratorDriver - see Roslyn #69906 - void ISourceGenerator.Execute(GeneratorExecutionContext context) { } } } diff --git a/test/Dapper.AOT.Test/GeneratorTestBase.cs b/test/Dapper.AOT.Test/GeneratorTestBase.cs index 62466313..bf5d86f1 100644 --- a/test/Dapper.AOT.Test/GeneratorTestBase.cs +++ b/test/Dapper.AOT.Test/GeneratorTestBase.cs @@ -37,7 +37,7 @@ protected GeneratorTestBase(ITestOutputHelper? log) [CallerMemberName] string? name = null, string? fileName = null, Action? initializer = null - ) where T : class, ISourceGenerator, new() // strictly we only need IIncrementalGenerator, but: see Roslyn #69906 + ) where T : class, IIncrementalGenerator, new() { void OutputDiagnostic(Diagnostic d) { @@ -67,7 +67,7 @@ void Output(string message, bool force = false) ShowDiagnostics("Input code", inputCompilation, diagnosticsTo, "CS8795", "CS1701", "CS1702"); // Create the driver that will control the generation, passing in our generator - GeneratorDriver driver = CSharpGeneratorDriver.Create(new[] { generator }, parseOptions: RoslynTestHelpers.ParseOptionsLatestLangVer); + GeneratorDriver driver = CSharpGeneratorDriver.Create(new[] { generator.AsSourceGenerator() }, parseOptions: RoslynTestHelpers.ParseOptionsLatestLangVer); // Run the generation pass // (Note: the generator driver itself is immutable, and all calls return an updated version of the driver that you should use for subsequent calls)