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

Symbol.Description does not need to be virtual #2045

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

adamsitnik
Copy link
Member

Symbol.Description does not need to be virtual, we can pass the description to ctor when creating every Symbol

the affected ctors belonged to internal types

…iption to ctor when creating every Symbol

the affected ctors belonged to internal types
@@ -316,7 +316,7 @@ void Default(Exception exception, InvocationContext context)
/// <returns>The same instance of <see cref="CommandLineBuilder"/>.</returns>
public static CommandLineBuilder UseHelp(this CommandLineBuilder builder, int? maxWidth = null)
{
return builder.UseHelp(new HelpOption(() => builder.LocalizationResources), maxWidth);
return builder.UseHelp(new HelpOption(builder.LocalizationResources), maxWidth);

Choose a reason for hiding this comment

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

If the application first calls CommandLineBuilderExtensions.UseDefaults and then calls CommandLineBuilderExtensions.UseLocalizationResources, this PR will prevent the help from using the application-specified resources.

Choose a reason for hiding this comment

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

I suppose the application could fix that by calling CommandLineBuilderExtensions.UseLocalizationResources before CommandLineBuilderExtensions.UseDefaults. But if there is such a constraint, then it should be mentioned in the documentation of CommandLineBuilderExtensions.UseLocalizationResources.

Copy link
Member Author

Choose a reason for hiding this comment

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

That is correct, but we are soon going to make LocalizationResources internal and never expose it again (#2041).

Choose a reason for hiding this comment

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

#1915 still "needs discussion".

Copy link
Contributor

Choose a reason for hiding this comment

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

I had meant to comment on this last week. I've updated #1915 with some thoughts on this.

@adamsitnik adamsitnik merged commit 8e8c69a into dotnet:main Feb 22, 2023
@adamsitnik adamsitnik deleted the nonVirtualDescription branch February 22, 2023 18:54
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