Skip to content

Implement metadata reference provider#55052

Merged
chsienki merged 3 commits intodotnet:mainfrom
chsienki:source-generators/references-input
Aug 31, 2021
Merged

Implement metadata reference provider#55052
chsienki merged 3 commits intodotnet:mainfrom
chsienki:source-generators/references-input

Conversation

@chsienki
Copy link
Copy Markdown
Member

@chsienki chsienki commented Jul 22, 2021

Implements a provider for metadata references. Addresses part of #54272

API Review: #55130

closes #55130

@chsienki chsienki added this to the 17.0.P3 milestone Jul 22, 2021
@chsienki chsienki requested a review from a team as a code owner July 22, 2021 19:12
@333fred
Copy link
Copy Markdown
Member

333fred commented Jul 23, 2021

@chsienki, are you going to bring this to design review by itself, or do you want to do a bigger one with all the suggestions in #54272?

@chsienki
Copy link
Copy Markdown
Member Author

@333fred Was planning to just bring it by itself. Do we need an issue to track, or can we just use this PR?

@333fred
Copy link
Copy Markdown
Member

333fred commented Jul 23, 2021

@333fred Was planning to just bring it by itself. Do we need an issue to track, or can we just use this PR?

Let's do a separate issue, that way the notes will have an issue to link to.

@chsienki
Copy link
Copy Markdown
Member Author

@dotnet/roslyn-compiler for review, now API review is approved.

@chsienki chsienki modified the milestones: 17.0.P3, 17.0 Aug 11, 2021
Copy link
Copy Markdown
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.

One small bit of test feedback.

@chsienki
Copy link
Copy Markdown
Member Author

Ping @dotnet/roslyn-compiler for review please :)


public static readonly InputNode<AnalyzerConfigOptionsProvider> AnalyzerConfigOptions = new InputNode<AnalyzerConfigOptionsProvider>(b => ImmutableArray.Create(b.DriverState.OptionsProvider));

public static readonly InputNode<MetadataReference> MetadataReferences = new InputNode<MetadataReference>(b => b.Compilation.References.AsImmutable());
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As a bit of an aside Im' surprised this already isn't an ImmutableArray. The implementation is an iterator and we use it several times during compilation.

Copy link
Copy Markdown
Member Author

@chsienki chsienki Aug 26, 2021

Choose a reason for hiding this comment

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

I updated it to use ExternalReferences which is immutable, as we aren't running source generators in an interactive context.

@jaredpar
Copy link
Copy Markdown
Member

@RikkiGibson PTAL

@jaredpar
Copy link
Copy Markdown
Member

@333fred can you take a look at this API change? Would be nice to have for P5

@chsienki chsienki merged commit 1aeee28 into dotnet:main Aug 31, 2021
@ghost ghost modified the milestones: 17.0, Next Aug 31, 2021
@dibarbet dibarbet modified the milestones: Next, 17.0.P4 Aug 31, 2021
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.

Make MetadataReferences a top level SG input

4 participants