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

Share more code between "Generate Constructor", "Add Parameter" and "Initialize Member from Parameter" #76359

Conversation

CyrusNajmabadi
Copy link
Member

Precursor to #76352

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner December 10, 2024 21:32
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Dec 10, 2024
@CyrusNajmabadi
Copy link
Member Author

@JoeRobich @ToddGrun ptal.

@@ -103,12 +110,13 @@ public static async Task<Solution> AddParameterAsync(
if (syntaxFacts is null)
continue;

var semanticDocument = await SemanticDocument.CreateAsync(document, cancellationToken).ConfigureAwait(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

semanticDocument

used?

Copy link
Member Author

Choose a reason for hiding this comment

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

nope. removing.

@@ -60,12 +60,10 @@ protected internal sealed class State
public ImmutableDictionary<string, string> ParameterToNewPropertyMap { get; private set; }
public bool IsContainedInUnsafeType { get; private set; }

private State(TService service, SemanticDocument document, NamingRule fieldNamingRule, NamingRule propertyNamingRule, NamingRule parameterNamingRule)
private State(TService service, SemanticDocument document, NamingRule parameterNamingRule)
Copy link
Contributor

Choose a reason for hiding this comment

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

private State(TService service, SemanticDocument document, NamingRule parameterNamingRule)

very unlike you not to change this to a primary ctor :)

Copy link
Contributor

@ToddGrun ToddGrun left a comment

Choose a reason for hiding this comment

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

:shipit:

@CyrusNajmabadi CyrusNajmabadi enabled auto-merge (squash) December 10, 2024 23:15
@CyrusNajmabadi CyrusNajmabadi merged commit 1c76e76 into dotnet:main Dec 10, 2024
25 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the genConstructorInitializeFieldNoFunctional branch December 10, 2024 23:19
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Dec 10, 2024
@dibarbet dibarbet modified the milestones: Next, 17.13 P3 Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants