Skip to content
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

Merged
merged 8 commits into from
Aug 29, 2020
Merged

Conversation

chsienki
Copy link
Contributor

  • Rename SourceGeneratorContext -> GeneratorExecutionContext
  • Rename IntializationContext -> GeneratorIntializtionContext
  • Rename RunFullGeneration -> RunGeneratorsAndUpdateCompilation
  • Add 'Create' static methods to make unit testing easier
  • Update tests + documentation

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)

- Rename SourceGeneratorContext -> GeneratorExecutionContext
- Rename IntializationContext -> GeneratorIntializtionContext
- Rename RunFullGeneration -> RunGeneratorsAndUpdateCompilation
- Add 'Create' static methods to make unit testing easier
- Update tests + documentation
@chsienki chsienki added this to the 16.8.P3 milestone Aug 28, 2020
@chsienki chsienki requested review from a team as code owners August 28, 2020 02:13
@chsienki chsienki self-assigned this Aug 28, 2020
@chsienki
Copy link
Contributor Author

@dotnet/roslyn-compiler for review.

Copy link
Contributor

@davidwengier davidwengier left a 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
Copy link
Member

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.

Copy link
Member

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)

@dotnet dotnet deleted a comment from chsienki Aug 28, 2020
333fred
333fred previously approved these changes Aug 28, 2020
Copy link
Member

@333fred 333fred left a 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)

@333fred 333fred dismissed their stale review August 28, 2020 21:09

Wrong button

- 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
Copy link
Member

@333fred 333fred left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (commit 5)

@chsienki chsienki merged commit fd0e852 into dotnet:master Aug 29, 2020
@ghost ghost modified the milestones: 16.8.P3, Next Aug 29, 2020
333fred added a commit to 333fred/roslyn that referenced this pull request Aug 31, 2020
* 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
  ...
@allisonchou allisonchou modified the milestones: Next, 16.8.P3 Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants