Skip to content
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

@{ block format on type adds New Line on pressing ';' #5083

Closed
TanayParikh opened this issue Oct 21, 2020 · 2 comments · Fixed by #3813 or #4128
Closed

@{ block format on type adds New Line on pressing ';' #5083

TanayParikh opened this issue Oct 21, 2020 · 2 comments · Fixed by #3813 or #4128
Assignees
Milestone

Comments

@TanayParikh
Copy link
Contributor

BracketNewLine

I was anticipating either:

  1. Final space added-> @{ Debugger.Launch(); }
  2. Both new lines
@{
    Debugger.Launch();
}
@ajaybhargavb ajaybhargavb changed the title @{ Block Formatting New Line @{ block format on type adds New Line on pressing ; Oct 21, 2020
@ajaybhargavb ajaybhargavb changed the title @{ block format on type adds New Line on pressing ; @{ block format on type adds New Line on pressing ';' Oct 21, 2020
@NTaylorMullen
Copy link
Contributor

This still repros on latest 16.9-Preview3

sharwell referenced this issue in sharwell/razor Feb 16, 2021
Fixes dotnet/aspnetcore#27102
sharwell referenced this issue in sharwell/razor Feb 16, 2021
Fixes dotnet/aspnetcore#27102
@sharwell
Copy link
Member

This one is rough. FormattingContext.Indentations assumes that each line starts in one context, and contains at most 1 transition to a different context. The formatter cannot represent lines with more than one context switch, such as single-line elements that transition and then transition back.

@ghost ghost locked as resolved and limited conversation to collaborators Jul 30, 2021
@ghost ghost unlocked this conversation Oct 8, 2021
@allisonchou allisonchou transferred this issue from dotnet/aspnetcore Oct 8, 2021
@allisonchou allisonchou added this to the 17.0-Preview2 milestone Oct 8, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.