-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update generator public API names: #47222
Conversation
- Rename SourceGeneratorContext -> GeneratorExecutionContext - Rename IntializationContext -> GeneratorIntializtionContext - Rename RunFullGeneration -> RunGeneratorsAndUpdateCompilation - Add 'Create' static methods to make unit testing easier - Update tests + documentation
@dotnet/roslyn-compiler for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some slides to update...
@@ -1027,7 +1027,6 @@ Microsoft.CodeAnalysis.GeneratorDriver.AddAdditionalTexts(System.Collections.Imm | |||
Microsoft.CodeAnalysis.GeneratorDriver.AddGenerators(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISourceGenerator> generators) -> Microsoft.CodeAnalysis.GeneratorDriver | |||
Microsoft.CodeAnalysis.GeneratorDriver.RemoveGenerators(System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.ISourceGenerator> generators) -> Microsoft.CodeAnalysis.GeneratorDriver | |||
Microsoft.CodeAnalysis.GeneratorDriver.RunFullGeneration(Microsoft.CodeAnalysis.Compilation compilation, out Microsoft.CodeAnalysis.Compilation outputCompilation, out System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic> diagnostics, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.GeneratorDriver | |||
Microsoft.CodeAnalysis.GeneratorDriver.TryApplyEdits(Microsoft.CodeAnalysis.Compilation compilation, out Microsoft.CodeAnalysis.Compilation outputCompilation, out bool success, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> Microsoft.CodeAnalysis.GeneratorDriver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be *REMOVED*
entries in Unshipped, which will then be updated when we mark the APIs as shipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The shipped file itself should not have these removed yet.
In reply to: 479529914 [](ancestors = 479529914)
src/Compilers/Core/Portable/SourceGeneration/GeneratorContexts.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/SourceGeneration/GeneratorDriver.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done review pass (commit 2)
- Make public ctor obsolete in prep for making it internal - Use .Create in test instead - Don't forward the old overload in GeneratorDriver - Make obsolete warnings errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (commit 5)
* upstream/master: (43 commits) Fix typos (dotnet#47264) Disable CS0660 where Full Solution Analysis produces a different result Pass in correct arguments to TypeScript handler Add skipped failing test for IDE0044 (dotnet#45288) Avoid first chance exception Code review feedback part 3 Update stale URLs in the readme Update IntegrationTestSourceGenerator.cs Fix comment Update IntegrationTestSourceGenerator.cs Remove unused reference to obsolete class Update nullable annotations in Classification folder Update generator public API names: (dotnet#47222) NullableContextAttribute for property parameters is from accessor (dotnet#47223) Modify global analyzer config precedence: (dotnet#45871) Skip the C# source generator integration test running for now Additional XAML LSP handlers (dotnet#47217) Remap diagnostics using IWorkspaceVenusSpanMappingService in-proc Warn on type named "record" (dotnet#47094) Bail out early before getting SyntaxTree ...
Note: this is mostly a mechanical refactoring of names, but also keeps the original type names as empty types with
[Obsolete]
attributes; this gives users a chance to see what the type was renamed to. We'll remove the obsolete types in the next preview (tracked by #46623)