Skip to content

First name and aliases cleanup #1990

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

Merged
merged 7 commits into from
Dec 14, 2022
Merged

Conversation

adamsitnik
Copy link
Member

  • Multiple types derived from Symbol were defining it's own name field. I've removed these and now all of them are just using _name defined by Symbol
  • As agreed with Jon (not tagging him as he is on vacations) removing Option.HasAliasIgnoringPrefix as it's not for general purpose
  • making GetLongestAlias part of base type and re-using it where possible
  • encapsulating _aliases field, as it will most likely change once we introduce the concept of a hidden alias

@adamsitnik adamsitnik requested review from Keboo and jozkee December 12, 2022 21:48
Copy link
Member

@Keboo Keboo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

var alias = identifierSymbol.Aliases.First();
var alias = identifierSymbol.GetLongestAlias(removePrefix: false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't really getting the longest alias but the first one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was inconsistent. As you can see other places in the source code were using longest option alias to get its default alias. Here we were using the first one but it was a bug (at least in my opinion).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this just use the name rather than an alias?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Option.Name should not contain the prefix, while here we care about prefix.

@adamsitnik adamsitnik merged commit 18027bd into dotnet:main Dec 14, 2022
@adamsitnik adamsitnik deleted the hiddenAliases branch December 14, 2022 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants