views:

290

answers:

6

I've looked, but it doesn't look like you can apply specific formatting to just comments.

+1  A: 

I have not used the most recent version, but older versions did not.

Patrick Cornelissen
A: 

You can extend VS 2010 to do this http://code.msdn.microsoft.com/ToDoGlyphFactory

Raj Kaimal
+1  A: 

No. The shortcut is Ctrl+E, Ctrl+W.

There would be one trick how to format the comments. Write your own code snippet for the comment.

nubm
+3  A: 

Well, there is an Add-In which will automatically format your comments to a given width (as a side feature).

It is HyperAddIn - the main feature of which is allowing you to create 'hyperlinks' to other places in your code within comments, like this:

// The other half of this logic is in code:ComponentManager.Initialise()

With HyperAddIn installed, the code:ComponentManager.Initialise() becomes a clickable link.

I have it installed, it works OK, but I must admit that most of the time I don't have the comment formatting switched on.

Benjol
+1  A: 

The free AtomeerUtils addin mentions such a feature:

  • Word-wrap the text in a block comment.

I have not tried it.

JRL
+2  A: 

It may not answer the question directly, but, instead of:

//Writing a really really long comment on one line that should probably be broken up into multiple lines anyhow

Why don't you:

//Break your comments up into multiple lines so that
//you don't need to worry about them wrapping?

Also, I don't like long lines of code - break them up across multiple lines so it's easier to read. All a matter of preference I know, but if you have to scroll horizontally to see all the code, it's a good sign it needs formatting better IMO.

Michael
This is an epic pain to manage. If you add to or elaborate on your comment, you have to go back and fix all the hard line breaks you added.
Deane
@Deane: I don't know, I've used this method for over 10 years and it's been fine. Of course, it's anecdotal, but I do think you can trivially follow this approach (and it's "scalable" to any editor :P)
Noon Silk