Skip to content

Add test for formatting multiline raw string literal#12809

Merged
davidwengier merged 4 commits intodotnet:mainfrom
davidwengier:FormattingMultilineRawStringLiteral
Feb 21, 2026
Merged

Add test for formatting multiline raw string literal#12809
davidwengier merged 4 commits intodotnet:mainfrom
davidwengier:FormattingMultilineRawStringLiteral

Conversation

@davidwengier
Copy link
Copy Markdown
Member

Looking into https://developercommunity.visualstudio.com/t/Format-Document-in-a-blazor-documents-ad/11046727, and it was already fixed by the recent Html formatting changes, but figured we should have a test.

@davidwengier davidwengier requested a review from a team as a code owner February 21, 2026 10:42
#if DEBUG
}
<div />
<div />
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Now that the tests are using the Roslyn tokenizer, this is now parsed as C#, hence doesn't move.

await RunFormattingTestAsync(
input: """"
<PageTitle>
<PageTitle>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PageTitle

I wouldn't have thought to have nested this tag

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Definitely doesn't make sense in real life, but for formatting the shape of the syntax tree is all that really matters. The original repro has the string nested in a couple of components, so this is emulating that. Logically it shouldn't matter to the formatter if they're components or divs, and realistically it's not super useful as the original repros components could have something weird or specific about them that triggers this bug, but we don't have them, and the bug seems to already be fixed, so this will have to do.

Copy link
Copy Markdown
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:

@davidwengier davidwengier merged commit c640a1c into dotnet:main Feb 21, 2026
10 checks passed
@davidwengier davidwengier deleted the FormattingMultilineRawStringLiteral branch February 21, 2026 20:43
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Feb 21, 2026
@akhera99 akhera99 modified the milestones: Next, 18.5 Feb 24, 2026
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.

3 participants