-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Fix issue with improper formatting in introduce-variable #73392
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,22 @@ | |
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
#nullable disable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. view with whitespace off. |
||
|
||
using Microsoft.CodeAnalysis.CodeCleanup; | ||
|
||
namespace Microsoft.CodeAnalysis.IntroduceVariable; | ||
|
||
internal partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax, TNameSyntax> | ||
{ | ||
private class IntroduceVariableCodeAction : AbstractIntroduceVariableCodeAction | ||
private sealed class IntroduceVariableCodeAction( | ||
TService service, | ||
SemanticDocument document, | ||
CodeCleanupOptions options, | ||
TExpressionSyntax expression, | ||
bool allOccurrences, | ||
bool isConstant, | ||
bool isLocal, | ||
bool isQueryLocal) : AbstractIntroduceVariableCodeAction( | ||
service, document, options, expression, allOccurrences, isConstant, isLocal, isQueryLocal) | ||
{ | ||
internal IntroduceVariableCodeAction( | ||
TService service, | ||
SemanticDocument document, | ||
CodeCleanupOptions options, | ||
TExpressionSyntax expression, | ||
bool allOccurrences, | ||
bool isConstant, | ||
bool isLocal, | ||
bool isQueryLocal) | ||
: base(service, document, options, expression, allOccurrences, isConstant, isLocal, isQueryLocal) | ||
{ | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,40 +2,22 @@ | |
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
#nullable disable | ||
|
||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Microsoft.CodeAnalysis.CaseCorrection; | ||
using Microsoft.CodeAnalysis.CodeCleanup; | ||
using Microsoft.CodeAnalysis.Formatting; | ||
using Microsoft.CodeAnalysis.Simplification; | ||
|
||
namespace Microsoft.CodeAnalysis.IntroduceVariable; | ||
|
||
internal partial class AbstractIntroduceVariableService<TService, TExpressionSyntax, TTypeSyntax, TTypeDeclarationSyntax, TQueryExpressionSyntax, TNameSyntax> | ||
{ | ||
private class IntroduceVariableAllOccurrenceCodeAction : AbstractIntroduceVariableCodeAction | ||
private class IntroduceVariableAllOccurrenceCodeAction( | ||
TService service, | ||
SemanticDocument document, | ||
CodeCleanupOptions options, | ||
TExpressionSyntax expression, | ||
bool allOccurrences, | ||
bool isConstant, | ||
bool isLocal, | ||
bool isQueryLocal) : AbstractIntroduceVariableCodeAction( | ||
service, document, options, expression, allOccurrences, isConstant, isLocal, isQueryLocal) | ||
{ | ||
internal IntroduceVariableAllOccurrenceCodeAction( | ||
TService service, | ||
SemanticDocument document, | ||
CodeCleanupOptions options, | ||
TExpressionSyntax expression, | ||
bool allOccurrences, | ||
bool isConstant, | ||
bool isLocal, | ||
bool isQueryLocal) | ||
: base(service, document, options, expression, allOccurrences, isConstant, isLocal, isQueryLocal) | ||
{ | ||
} | ||
|
||
protected override async Task<Document> PostProcessChangesAsync(Document document, CancellationToken cancellationToken) | ||
{ | ||
document = await Simplifier.ReduceAsync(document, Simplifier.Annotation, Options.SimplifierOptions, cancellationToken).ConfigureAwait(false); | ||
document = await Formatter.FormatAsync(document, Formatter.Annotation, Options.FormattingOptions, cancellationToken).ConfigureAwait(false); | ||
document = await CaseCorrector.CaseCorrectAsync(document, CaseCorrector.Annotation, cancellationToken).ConfigureAwait(false); | ||
return document; | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removing this method is the fix. it was trying to override the formatitng pass. however, my prior pr fixes things so that formatting happens at the right phase. |
||
} | ||
} |
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.
old formatting was wrong here.
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.
includes changes from #73392. once that goes in, this won't be part of this pr.