-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Use new [Interceptable] ctor for source gen #104180
Conversation
Tagging subscribers to this area: @dotnet/area-extensions-configuration |
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingGenerator.cs
Outdated
Show resolved
Hide resolved
int? interceptableVersion = null; | ||
|
||
#if UPDATE_BASELINES | ||
const string envVarName = "InterceptableAttributeVersion"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just here. I removed the const and just inlined the string.
src/libraries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingGenerator.cs
Show resolved
Hide resolved
...aries/Microsoft.Extensions.Configuration.Binder/gen/ConfigurationBindingGenerator.Emitter.cs
Outdated
Show resolved
Hide resolved
@@ -7,6 +7,7 @@ | |||
<AnalyzerLanguage>cs</AnalyzerLanguage> | |||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |||
<DefineConstants Condition="'$(LaunchDebugger)' == 'true'">$(DefineConstants);LAUNCH_DEBUGGER</DefineConstants> | |||
<DefineConstants Condition="'$(UpdateBaselines)' == 'true'">$(DefineConstants);UPDATE_BASELINES</DefineConstants> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left minor comments, LGTM otherwise.
We need to decide if we continue to go with the environment variable. Will be good if @RikkiGibson look too. Thanks!
This reverts commit 0413759.
Fixes #101079
This changes the use of the experimental
[Interceptable]
attribute to use the newer version provided by Roslyn.This affects the test baselines, and depending on the environment there may be an older Roslyn present, so both the original and the new baselines are in this PR. See the linked issue as well as the
ReadMe.md
file in the changed files here to get more information.To avoid breaking v8, this PR will eventually need to be ported to v8 since the original version of the attribute will eventually no longer be supported. It may be possible to only have the newer baseline for v9, however both are included here, and the plan is to essentially port this PR as-is to v8. Once the original version is no longer necessary, we can remove the "version 0" baselines and perhaps the infrastructure for having two baselines, assuming at that time Rosyln has no plans to add a third version.