I am a long time Atom user. I finally decided to switch over to VS Code but there is one thing that if I cannot solve I am going back to Atom. I am a hardware engineer so I primarily write C code. I am looking for a way to fix the IntelliSense snippet code formatting.
For example, when I start typing while
and press Tab to autocomplete, I get this:
while (/* condition */)
{
/* code */
}
I am looking for a way for the autocomplete to put the curly brace on the same line as such:
while (/* condition */) {
/* code */
}
From what I can tell, the only way to change this is to edit the default snippets that come with the C/C++ extension. I have tried going to ~/.vscode/extensions/ms-vscode.cpptools-1.2.2
(I am on a Mac) but to no avail. There is no snippets folder.
I have also tried adding
"C_Cpp.vcFormat.newLine.beforeOpenBrace.block": "sameLine",
"C_Cpp.vcFormat.newLine.beforeOpenBrace.function": "sameLine",
"C_Cpp.vcFormat.newLine.beforeOpenBrace.lambda": "sameLine",
"C_Cpp.vcFormat.newLine.beforeOpenBrace.namespace": "sameLine",
"C_Cpp.vcFormat.newLine.beforeOpenBrace.type": "sameLine",
"C_Cpp.clang_format_style": "WebKit",
"C_Cpp.clang_format_fallbackStyle": "WebKit"
to the settings.json
file but, again, nothing.
This is incredibly important to fix for me so if you have any solutions I am all ears. Thank you.