Skip to content

Fix formatting of script tags that have/are tag helpers#12922

Merged
davidwengier merged 10 commits intodotnet:mainfrom
davidwengier:FormattingFailsWhenScriptTagIsTagHelper
Mar 25, 2026
Merged

Fix formatting of script tags that have/are tag helpers#12922
davidwengier merged 10 commits intodotnet:mainfrom
davidwengier:FormattingFailsWhenScriptTagIsTagHelper

Conversation

@davidwengier
Copy link
Copy Markdown
Member

I found this while investigating https://developercommunity.visualstudio.com/t/visual-studio-2026-doesnt-format-javasc/11060696

A lot of our cod that detected things like pre, textarea, script etc. tags only checked MarkupElementSyntax, but since MVC can allow any arbitrary tag to become a MarkupTagHelperElementSyntax, that causes issues. To help solve this once and for all, changing the shape of the syntax tree seemed the most appropriate, same as we did with start and end tag syntax nodes previously. Due to the nature of that change being pretty viral, there is a bit more to review here than just the fix for the bug. I introduced a few new helper properties to help with further targeted simplification too.

davidwengier and others added 8 commits March 19, 2026 11:58
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@davidwengier davidwengier requested a review from a team as a code owner March 19, 2026 01:50
@davidwengier
Copy link
Copy Markdown
Member Author

Ping @dotnet/razor-tooling, this PR from last week might have slipped through the cracks

@davidwengier davidwengier merged commit d9362b9 into dotnet:main Mar 25, 2026
10 checks passed
@davidwengier davidwengier deleted the FormattingFailsWhenScriptTagIsTagHelper branch March 25, 2026 00:37
@dotnet-policy-service dotnet-policy-service Bot added this to the Next milestone Mar 25, 2026
@jjonescz jjonescz modified the milestones: Next, 18.6 Mar 31, 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