Skip to content

Commit fa496ce

Browse files
Apply suggestions from code review
Co-authored-by: Copilot <[email protected]>
1 parent 5fcef13 commit fa496ce

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPass.CSharpDocumentGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public override LineInfo VisitMarkupTransition(MarkupTransitionSyntax node)
611611
// }
612612
// </div>;
613613
//
614-
// If we convert that to C# the like we normally do, we end up with statements in a C# context where only
614+
// If we convert that to C# the way we normally do, we end up with statements in a C# context where only
615615
// expressions are valid. To avoid that, we need to emit C# such that we can be sure we're in a context
616616
// where statements are valid. To do this we emit a block bodied lambda expression. Ironically this whole
617617
// formatting engine arguably exists because the compiler loves to emit lambda expressions, but they're
@@ -629,7 +629,7 @@ public override LineInfo VisitMarkupTransition(MarkupTransitionSyntax node)
629629

630630
// Roslyn may move the opening brace to the next line, depending on its options. Unlike with code block
631631
// formatting where we put the opening brace on the next line ourselves (and Roslyn might bring it back)
632-
// if we do that for lambdas, Roslyn wont' adjust the opening brace position at all. See, told you lambdas
632+
// if we do that for lambdas, Roslyn won't adjust the opening brace position at all. See, told you lambdas
633633
// were annoying to format.
634634
_builder.AppendLine("() => {");
635635
return CreateLineInfo(skipNextLineIfBrace: true);

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/Formatting/Passes/CSharpFormattingPass.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public async Task<ImmutableArray<TextChange>> ExecuteAsync(FormattingContext con
147147
else if (lineInfo.SkipNextLineIfBrace)
148148
{
149149
// If the next line is a brace, we skip it. This is used to skip the opening brace of a class
150-
// that we insert, but Roslyn settings might place on the same like as the class declaration,
150+
// that we insert, but Roslyn settings might place on the same line as the class declaration,
151151
// or skip the opening brace of a lambda definition we insert, but Roslyn might place it on the
152152
// next line. In that case, we can't place it on the next line ourselves because Roslyn doesn't
153153
// adjust the indentation of opening braces of lambdas in that scenario.

0 commit comments

Comments
 (0)