Repository navigation
Freeze the generator and analyzer API shape before 1.0 - #383
Merged
Merged
Conversation
Breaking changes to the public API of Stunts.CompiledProxy and Stunts.CodeAnalysis, which the Stunts.CompiledProxy package exposes to the libraries that build a generator on StuntGenerator. - Move INamedTypeSymbolExtensions out of the Roslyn namespace Microsoft.CodeAnalysis.Shared.Extensions into Stunts.CodeAnalysis, and UnsafeSignatureAnalyzer from Stunts into Stunts.CodeAnalysis. - Rename StuntDiagnostics.BaseTypeNoContructor to BaseTypeNoConstructor, and remove the PointerMember descriptor: ST005 is reserved and not reported. - Seal the StuntGenerator and ProcessorContext records. ProcessorContext.Compilation is set by this assembly only. - IStuntCandidatesProvider.GetCandidates returns (SyntaxNode Source, ImmutableArray<INamedTypeSymbol> Types). - Remove ISyntaxProcessor.Language: compile-time stunts are C# only. - Make internal what was public by accident: DependencyResolver, SyntaxProcessorDriver, NestedTypeStunt, StuntClosure and its result types, and the members of SymbolExtensions other than CanBeIntercepted. Remove InterceptableRecursively, which had no caller. - Remove SymbolFullNameExtensions and the Superpower dependency, which only tests used: Superpower.dll leaves the Stunts package. - UnsafeSignatureAnalyzer follows the generator for the registration attribute: none for a custom generator attribute unless given, and null means none. - Say in the Stunts.CompiledProxy readme which diagnostics only the analyzers report and how an extender derives from them. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-authored-by: CodeAlta <noreply@codealta.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fourth step of the pre-1.0 API freeze: the breaking changes to the public API of
Stunts.CompiledProxyandStunts.CodeAnalysis, which theStunts.CompiledProxypackage exposes to libraries that build a generator onStuntGenerator.Breaking changes
Microsoft.CodeAnalysis.Shared.Extensions.INamedTypeSymbolExtensionsStunts.CodeAnalysis.INamedTypeSymbolExtensionsStunts.UnsafeSignatureAnalyzerStunts.CodeAnalysis.UnsafeSignatureAnalyzerStuntDiagnostics.BaseTypeNoContructorBaseTypeNoConstructorStuntDiagnostics.PointerMember(ST005)record StuntGenerator,record ProcessorContextsealed recordProcessorContext.Compilation { get; init; }{ get; internal init; }GetCandidatesreturns(SyntaxNode source, INamedTypeSymbol[] candidate)(SyntaxNode Source, ImmutableArray<INamedTypeSymbol> Types)ISyntaxProcessor.LanguageLanguageof the built-in processors: compile-time stunts are C# onlyDependencyResolver,SyntaxProcessorDriver,NestedTypeStunt,StuntClosure,StuntClosureResult,StuntDefinition,StuntClosureErrorSymbolExtensions.IsRegistrationAttribute,ValidateGeneratorTypes,TryValidateGeneratorTypesCanBeInterceptedstays publicSymbolExtensions.InterceptableRecursivelySymbolFullNameExtensions(ToFullName,GetTypeByFullName)Superpower.dllleaves theStuntspackageUnsafeSignatureAnalyzer(Type generatorAttribute)readStuntAttribute<>registrations for any generator attributeUnsafeSignatureAnalyzer(Type, Type registrationAttribute)(Type, Type? registrationAttribute), where null means noneAlso
Stunts.CompiledProxyreadme says which diagnostics the generator reports itself (ST003,ST006,ST007,ST012,ST013,ST015,ST020,ST021,ST025toST027) and which only the analyzers report (ST001,ST002,ST004,ST008toST010,ST016toST019,ST023), with an example of deriving from each analyzer.Stunts.targetsand the reserved ids.Verified locally: build, 461 of 461 tests (the tests of the removed helper and of
ST005are gone, two were added), format checks, the package file lists, the acceptance solution, the Native AOT binary for net8.0 and net10.0, and the standalone package: anetstandard2.0generator built from the readme's snippets as written, and a consumer that gets its types generated next to the stunts. Not run locally:framework-compiler.ps1.This pull request was created by CodeAlta.
🤖 Generated with Claude Code