-
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
Format list patterns #57568
Format list patterns #57568
Conversation
|
||
namespace Microsoft.CodeAnalysis.CSharp.BraceCompletion | ||
{ | ||
internal abstract class AbstractCurlyBraceOrBracketCompletionService : AbstractBraceCompletionService |
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.
This whole class is just a move from CurlyBraceCompletionService
except where noted.
var root = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); | ||
|
||
var startPoint = openingPoint; | ||
var endPoint = AdjustFormattingEndPoint(text, root, startPoint, closingPoint); |
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.
The code in CurlyBraceCompletionService.AdjustFormattingEndPoint
was previously inline at this point
{ | ||
var originalRoot = await document.GetRequiredSyntaxRootAsync(cancellationToken).ConfigureAwait(false); | ||
var closeBraceToken = originalRoot.FindToken(closingBraceEndPoint - 1); | ||
Debug.Assert(IsValidClosingBraceToken(closeBraceToken)); |
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.
This used to directly check for SyntaxKind.CloseBrace
src/Features/CSharp/Portable/BraceCompletion/AbstractCurlyBraceOrBracketCompletionService.cs
Outdated
Show resolved
Hide resolved
src/Features/CSharp/Portable/BraceCompletion/AbstractCurlyBraceOrBracketCompletionService.cs
Outdated
Show resolved
Hide resolved
src/Features/CSharp/Portable/BraceCompletion/AbstractCurlyBraceOrBracketCompletionService.cs
Outdated
Show resolved
Hide resolved
src/Features/CSharp/Portable/BraceCompletion/BracketBraceCompletionService.cs
Outdated
Show resolved
Hide resolved
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/FormattingHelpers.cs
Outdated
Show resolved
Hide resolved
...s/SharedUtilitiesAndExtensions/Compiler/CSharp/Formatting/Rules/IndentBlockFormattingRule.cs
Outdated
Show resolved
Hide resolved
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.
Done with review pass (iteration 7). Didn't review the existing code that we merely moved
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.
LGTM Thanks (iteration 9)
Fixes #57244
Extract out a common base class from the
CurlyBraceCompletionService
so that parts can be shared withBracketBraceCompeltionService
for list patterns, where we essentially want to format brackets as bracesRelates to test plan #51289