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

Report source generator failures in Hot Reload diagnostics #75029

Merged
merged 4 commits into from
Sep 10, 2024

Conversation

tmat
Copy link
Member

@tmat tmat commented Sep 9, 2024

In VS source generator diagnostics are reported by the IDE in the Error List. However, in balanced mode these might not be immediately reported. If Hot Reload is invoked before these diagnostics are reported the user wouldn't know why Hot Reload failed unless the diagnostics are included in Hot Reload output.

dotnet-watch also needs to see these diagnostics in the output of GetUpdatesAsync in order to report them.

The second commit fixes translation of Diagnostic to DiagnosticData. The translation requires Solution snapshot to look up diagnostic locations by syntax tree. It needs to use the snapshot that has source-generated files all up-to-date, otherwise it won't be able to find the documents references by the diagnostic and produces project-level diagnostics instead.

Fixes #70863 and https://github.com/dotnet/AspNetCore-ManualTests/issues/3080

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead labels Sep 9, 2024
@tmat tmat marked this pull request as ready for review September 9, 2024 21:55
@tmat tmat requested a review from a team as a code owner September 9, 2024 21:55
@tmat
Copy link
Member Author

tmat commented Sep 9, 2024

@davidwengier PTAL

…esults.cs

Co-authored-by: David Wengier <david.wengier@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EnC workspace does not report on generators diagnostics
3 participants