Skip to content

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

Open
davidwengier wants to merge 10 commits intodotnet:mainfrom
davidwengier:FormattingFailsWhenScriptTagIsTagHelper
Open

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

Conversation

@davidwengier
Copy link
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
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.

1 participant