-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Cleanup the code in FullyQualify #65654
Cleanup the code in FullyQualify #65654
Conversation
|
||
// Actual member name might differ by case. | ||
string memberName; | ||
if (IgnoreCase) | ||
if (ignoreCase) | ||
{ | ||
var member = container.GetMembers(name).FirstOrDefault(); | ||
memberName = member != null ? member.Name : 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.
not your change, but something seems weird here - parts I don't get
- the name given (looks like it comes from
GetNameAndArityOfSimpleName
) might not be the right case? - can we always pull the correctly cased name from the actual symbol?
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's what we're trying to do here. we're trying to find the actual properly cased symbol name (in the case of vb), but we fallback to the name as the user wrote it in case we don't find that symbol. (note: it seems weird that we wouldn't find it. the code is likely being too paranoid, but i'm not comfortable making a change there in this PR :)).
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.
yeah the part I didn't get is why we need to fallback to anything. fine to leave it how it is here
/// </summary> | ||
internal abstract class AbstractFullyQualifyCodeFixProvider : CodeFixProvider | ||
{ | ||
// Just to silence analyzer. |
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 is for RS1016?
If it reports for an abstract class, I guess it's a bug?
Precursor before some larger refactorings.