Newline formatting options
See original GitHub issueLooking for a way to configure auto-format for newlines. I’m a fan of this structure:
void foo() {
if (something) {
bar();
} else {
baz();
}
}
However the current auto-format will place all my curly braces on a new line. I’ve noticed that both TypeScript and JavaScript have the options placeOpenBraceOnNewLineForControlBlocks
and placeOpenBraceOnNewLineForFunctions
.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:17
- Comments:18 (9 by maintainers)
Top Results From Across the Web
newline Formatting Guidelines
You can, of course create bold, italic, and code highlighted inline marks. These can be created by selecting a word and using the...
Read more >Newline - Wikipedia
Newline is a control character or sequence of control characters in character encoding specifications such as ASCII, EBCDIC, Unicode, etc. This character ......
Read more >C# formatting options - .NET - Microsoft Learn
Learn about the code style options for formatting C# code files. ... The new-line options concern the use of new lines to format...
Read more >Line Formats (Comparing and Merging Files) - GNU.org
The formats contain newline characters where newlines are desired on output. ... To specify a line format, use one of the following options....
Read more >Adding a Newline Character To a String In Java - Xperti
A newline character, also known as the end of line (EOL), line break or line separator is a control character used to represent...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the meantimes we could create
omnisharp.json
which contains many property about omnisharp, and then restart omnisharpThis is what I use
However I would also support that omnisharp should also add vscode config contribution point
If you’re like me (and I know I am) you want the brackets on the same line for everything, not just control blocks. Here’s the full listing for all of the common squirrely bracket cases.
omnisharp.json
Omnisharp: Restart Omnisharp
.Omnisharp doesn’t presently reload the
omnisharp.json
files automatically, so if you make changes while you’re in the editor, you’ll have to restart Omnisharp again.It’s possible that I missed a couple of NewLine settings for edge cases. The formatting options don’t seem to be documented anywhere, but you can see them all in the code: http://source.roslyn.codeplex.com/#Microsoft.CodeAnalysis.CSharp.Workspaces/Formatting/CSharpFormattingOptions.cs,dac739b7b8a53984
HURRAY! This was the only thing left that was still bugging me about vscode. Thanks @Thaina for the PROTIP.