I'm running Visual Studio 2008 sp1 on Windows 7 Build 7100 32bit.
I've never had this problem before, even on different installs of Windows 7 RC.
when I finish a statement with a ';' or '}' or something, normally VS will auto format that line or block of code. It hasn't been for me.
I checked Tools->Options->Text Editor->C#->Formatting->General, and the 3 "Auto Format" check boxes are checked already. When I press the hot key to auto-format, it formats the source as expected.
Anyone have any idea why it's doing this?
What I have installed that might have something to do with this: VS2008 SP1 SQL Server 2008 sp1 Office 2007
Thanks for the help
As long as your code is syntactically correct (i.e. no stray brackets or End Ifs without matching Ifs), Visual Studio will reformat your whole file with one key chord: Hold down the Control key and then press K, followed by D. Boom! Everything looks pretty again.
The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F. On Linux Ctrl + Shift + I.
VS Code Auto Format On SaveOpen Visual Studio Code editor. Click the “Settings” gear icon in the bottom-left corner. Search “Formatter” and click the “Editor: Default Formatter” option. From the drop-down menu, select whichever code formatter you want to use.
I think I found what I did wrong. I changed the tab settings from Smart
to Block
. Apparently, the smart tabs setting is what triggers the autocomplete when you close a block or toss in a ;
@Joel thanks I also have the problem that type;
is not automatically formatted. Solution:Text Editor -> C/C++ -> Tabs ->Block
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With