-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add fixer to convert from bound generic types in nameof to unbound types. #75976
Conversation
Co-authored-by: Julien Couvreur <[email protected]>
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.
Change to compiler (single file Traits.cs
in tests) LGTM Thanks (iteration 59)
var ideDiagnosticIds = typeof(IDEDiagnosticIds).GetFields().Select(f => f.GetValue(f) as string).ToArray(); | ||
var unsupportedDiagnosticIds = ideDiagnosticIds.Except(supportedDiagnostics).ToArray(); | ||
|
||
Assert.Equal(numberOfUnsupportedDiagnosticIds, unsupportedDiagnosticIds.Length); |
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.
this part of hte test has never been helpful. and every time we add an analyzer/fixer it fails and all we do is increment those numbers. so i'm deleting.
@ToddGrun ptal. |
@@ -171,7 +171,7 @@ public void TestGettingCodeStyleSettingsProviderLanguageServiceAsync() | |||
var optionsWithUI = CSharpCodeStyleOptions.EditorConfigOptions | |||
.Remove(CSharpCodeStyleOptions.PreferredModifierOrder); | |||
|
|||
AssertEx.SetEqual(optionsWithUI, dataSnapShot.Select(setting => setting.Key.Option)); | |||
AssertEx.SetEqual(optionsWithUI.OrderBy(o => o.Name), dataSnapShot.Select(setting => setting.Key.Option).OrderBy(o => o.Name)); |
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.
So that when they differ, the diff you get isn't awful. Basically, the diff function does things linearly, which makes for awful adds/removes/moves :-)
|
||
foreach (var typeArgumentList in invocation.DescendantNodesAndSelf().OfType<TypeArgumentListSyntax>()) | ||
{ | ||
foreach (var argument in typeArgumentList.Arguments) |
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.
Gotcha. I'm ok with this.
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.
Followup to #75368. Adds an analyzer/fixer to move to the new simpler form.