Add fixer to convert from bound generic types in nameof to unbound types.#75976
Merged
CyrusNajmabadi merged 66 commits intodotnet:mainfrom Nov 21, 2024
Merged
Add fixer to convert from bound generic types in nameof to unbound types.#75976CyrusNajmabadi merged 66 commits intodotnet:mainfrom
CyrusNajmabadi merged 66 commits intodotnet:mainfrom
Conversation
Co-authored-by: Julien Couvreur <jcouv@users.noreply.github.com>
…into openTypes
…into openTypes
jcouv
reviewed
Nov 19, 2024
Member
jcouv
left a comment
There was a problem hiding this comment.
Change to compiler (single file Traits.cs in tests) LGTM Thanks (iteration 59)
CyrusNajmabadi
commented
Nov 20, 2024
| var ideDiagnosticIds = typeof(IDEDiagnosticIds).GetFields().Select(f => f.GetValue(f) as string).ToArray(); | ||
| var unsupportedDiagnosticIds = ideDiagnosticIds.Except(supportedDiagnostics).ToArray(); | ||
|
|
||
| Assert.Equal(numberOfUnsupportedDiagnosticIds, unsupportedDiagnosticIds.Length); |
Contributor
Author
There was a problem hiding this comment.
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.
Contributor
Author
|
@ToddGrun ptal. |
ToddGrun
reviewed
Nov 21, 2024
| .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)); |
Contributor
Contributor
Author
There was a problem hiding this comment.
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 :-)
ToddGrun
reviewed
Nov 21, 2024
|
|
||
| foreach (var typeArgumentList in invocation.DescendantNodesAndSelf().OfType<TypeArgumentListSyntax>()) | ||
| { | ||
| foreach (var argument in typeArgumentList.Arguments) |
Contributor
Contributor
Author
There was a problem hiding this comment.
Gotcha. I'm ok with this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Followup to #75368. Adds an analyzer/fixer to move to the new simpler form.