Skip to content

Disallow Options source gen produce diagnostics from outside the compilation#88396

Merged
tarekgh merged 3 commits into
dotnet:mainfrom
tarekgh:OptionsSourceGenDisallowDiagnosticsGeneratedFromOutsideTheCompilation
Jul 7, 2023
Merged

Disallow Options source gen produce diagnostics from outside the compilation#88396
tarekgh merged 3 commits into
dotnet:mainfrom
tarekgh:OptionsSourceGenDisallowDiagnosticsGeneratedFromOutsideTheCompilation

Conversation

@tarekgh

@tarekgh tarekgh commented Jul 4, 2023

Copy link
Copy Markdown
Member

Fixes #88152

@ghost ghost assigned tarekgh Jul 4, 2023
@ghost

ghost commented Jul 4, 2023

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-extensions-options
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes #88152

Author: tarekgh
Assignees: -
Labels:

area-Extensions-Options

Milestone: -

@tarekgh

tarekgh commented Jul 4, 2023

Copy link
Copy Markdown
Member Author

@xakep139 @geeknoid could you please have a look?

@tarekgh tarekgh added this to the 8.0.0 milestone Jul 4, 2023
@tarekgh tarekgh added the source-generator Indicates an issue with a source generator feature label Jul 4, 2023
Comment thread src/libraries/Microsoft.Extensions.Options/gen/Parser.cs Outdated
@tarekgh

tarekgh commented Jul 7, 2023

Copy link
Copy Markdown
Member Author

@xakep139 I have modified the fix to let the diagnostics use the closest location of the failure inside the compilation. I tested it with Visual Studio too :-) please have a look. Thanks!

@xakep139 xakep139 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added a few nit comments, but the PR LGTM

@tarekgh
tarekgh merged commit 60799cc into dotnet:main Jul 7, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-Options source-generator Indicates an issue with a source generator feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OptionsValidator source-gen causes VS analyzer to crash

3 participants