Skip to content
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

Merged
merged 6 commits into from
Nov 29, 2022

Conversation

CyrusNajmabadi
Copy link
Member

Precursor before some larger refactorings.


// 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;
Copy link
Member

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

  1. the name given (looks like it comes from GetNameAndArityOfSimpleName) might not be the right case?
  2. can we always pull the correctly cased name from the actual symbol?

Copy link
Member Author

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 :)).

Copy link
Member

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.
Copy link
Member

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?

@CyrusNajmabadi CyrusNajmabadi merged commit 96dc83d into dotnet:main Nov 29, 2022
@ghost ghost added this to the Next milestone Nov 29, 2022
@allisonchou allisonchou modified the milestones: Next, 17.5 P2 Nov 30, 2022
@CyrusNajmabadi CyrusNajmabadi deleted the fullyQualifyChange branch November 30, 2022 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants