C
C#5d ago
Honza K.

✅ What is happening with my VS?

See the video... When I type semicolon in razor file, VS automatically put multiple blank lines somehwere in the code block, why?
14 Replies
Ryan H.
Ryan H.5d ago
Oh my god hahahaha it almost looks like a coworker pranked you or something Do you have any 3rd party code formatting extensions installed?
Honza K.
Honza K.OP5d ago
Only for XAML (XamlStyler) but it never ever did this thing 😄
Ryan H.
Ryan H.5d ago
If that's the case this may be a bug with visual studio. Try poking around the text editor settings for C#'s code style
Ryan H.
Ryan H.5d ago
Perhaps somewhere here?
No description
Ryan H.
Ryan H.5d ago
Also update VS. If it's really a bug, it may be fixed in a newer version that you might not have
Honza K.
Honza K.OP5d ago
Just updated because this is crazy 😄 still a thing after the update
Honza K.
Honza K.OP5d ago
what helped was changing this from true to false
No description
Honza K.
Honza K.OP5d ago
didnt even know this is a thing in VS
Ryan H.
Ryan H.5d ago
Oh wow well yeah that's one way to do it. Glad that solved it
Honza K.
Honza K.OP5d ago
yeah, even went as far as opening rider (I really dont like rider)... thanks
Ryan H.
Ryan H.5d ago
Out of curiosity, if you type a bunch of semicolons like you did in the video, but with the "Format on type" thing off, then you format the document manually (CTRL K + CTRL D for visual studio), do the newlines appear?
Honza K.
Honza K.OP5d ago
no, newlines only appear when the format on type is on formatting the file manually works as expected, only placing whitespace before each ;
Ryan H.
Ryan H.5d ago
Yeah, insane bug. Oh well, hope it's fixed in a later release. Have to turning off the autoformatter isn't ideal
Honza K.
Honza K.OP5d ago
I'm somewhat okay with it being turned off as I press ctrl+k+d every time before saving 😄

Did you find this page helpful?