Macros for multiline comments in Visual Studio

In my previous post I tried using code snippet to handle multiline comments insertion, but I didn't achieve removing those comments.

What I want to achieve is something like the default behavior for xml files when using the comment and uncomment buttons.

Using macros I can get it! So one macro to put comment (modified from the sample macro in vs) and one to uncomment.

The first surround the start and end selection with comment markers (for c# /* */).

The second takes the caret position and strips the previous start comment marker (/*) and the following end comment marker (*/)

It handles /*  */ and <!-- --> tags. Not VB (yet?)

You can associate this macro with a couple of button (or replace the default ones) and that's it.

Hope this helps someone

posted @ domenica 2 dicembre 2007 00:02

Print
Comments have been closed on this topic.
«ottobre»
domlunmarmergiovensab
262728293012
3456789
10111213141516
17181920212223
24252627282930
31123456