I came across one of the most awesome meta-language features for C-style languages (specifically any language that has /* */ and // comment support). The nitty-gritties are up at a rather good blog. I whipped up a snippet to handle this automatically.
It has a few notable features – it gives a reason for the flip, it wraps it in a region, it has a auto-task FLIP: prefix and it explains how it’s used.
#region Flip - This new behaviour is experimental. -
// FLIP: This new behaviour is experimental.
//*/// Two proceding slashes will activate the first block, one will activate the second.
Console.ReadLine();
/*/
Console.ReadLine();
//*/
#endregion Flip - This new behaviour is experimental. -
Drop it in your My Code Snippets folder. In VS select the code you want to flip-comment, Hold CTRL, Press K, Press S, Release CTRL, Press M, Press Enter, Press F, Press Enter (I wish you could assign hot keys to snippets!).
Code Block Flipper (WordPress won’t let me upload .snippet – so you will need to rename it)
Jonathan Dickinson works at SourceCode. Everything posted on this blog is his personal opinion and do not necessarily represent the views of his employer or his employer's clients.
Code Block Toggler
I came across one of the most awesome meta-language features for C-style languages (specifically any language that has /* */ and // comment support). The nitty-gritties are up at a rather good blog. I whipped up a snippet to handle this automatically.
It has a few notable features – it gives a reason for the flip, it wraps it in a region, it has a auto-task FLIP: prefix and it explains how it’s used.
#region Flip - This new behaviour is experimental. - // FLIP: This new behaviour is experimental. //*/// Two proceding slashes will activate the first block, one will activate the second. Console.ReadLine(); /*/ Console.ReadLine(); //*/ #endregion Flip - This new behaviour is experimental. -Drop it in your My Code Snippets folder. In VS select the code you want to flip-comment, Hold CTRL, Press K, Press S, Release CTRL, Press M, Press Enter, Press F, Press Enter (I wish you could assign hot keys to snippets!).
Code Block Flipper (WordPress won’t let me upload .snippet – so you will need to rename it)