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

Razor internals #71762

Merged
merged 4 commits into from
Mar 8, 2024
Merged

Razor internals #71762

merged 4 commits into from
Mar 8, 2024

Conversation

chsienki
Copy link
Contributor

@chsienki chsienki commented Jan 23, 2024

Expose an extension via Razor EA that gives access to the GeneratorDriverRunResult for a given project.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 23, 2024
@@ -357,6 +357,11 @@ internal ValueTask<ImmutableArray<Diagnostic>> GetSourceGeneratorDiagnosticsAsyn
return _solution.CompilationState.GetSourceGeneratorDiagnosticsAsync(this.State, cancellationToken);
}

internal ValueTask<GeneratorDriverRunResult?> GetSourceGeneratorRunResultAsync(CancellationToken cancellationToken)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jasonmalinowski In a previous version of this PR, we discussed if we should replace GetSourceGeneratorDiagnosticsAsync with this method.

I chose to keep them separate because the diagnostics path actually returns data in the GeneratedFileReplacingCompilationTracker path, where the run result just throws. If we can figure out what the semantics of get run result would be in the GeneratedFileReplacingCompilationTracker then we could collapse them into a single method.

@chsienki
Copy link
Contributor Author

@jasonmalinowski @CyrusNajmabadi for thoughts.

@arunchndr arunchndr requested a review from genlu March 1, 2024 21:33

namespace Microsoft.CodeAnalysis.ExternalAccess.Razor
{
internal static class RazorProjectExtensions
Copy link
Member

Choose a reason for hiding this comment

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

Don't we keep track of the internal APIs for those EA assemblies as well? If so, I don't see the corresponding change in InternalAPI.Unshipped.txt

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, addded.

@genlu
Copy link
Member

genlu commented Mar 1, 2024

@chsienki I don't have the context on why this is needed, but the change itself looks good to me.

@chsienki chsienki marked this pull request as ready for review March 8, 2024 22:15
@chsienki chsienki requested a review from a team as a code owner March 8, 2024 22:15
@chsienki chsienki merged commit 026c963 into dotnet:main Mar 8, 2024
27 checks passed
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Mar 8, 2024
@RikkiGibson RikkiGibson modified the milestones: Next, 17.10 P3 Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants