I've looked, but it doesn't look like you can apply specific formatting to just comments.
相关问题
- How to know full paths to DLL's from .csproj f
- Importing NuGet references through a local project
- Visual Studio 2019 - error MSB8020: The build tool
- 'System.Threading.ThreadAbortException' in
- VS2017 RC - The following error occurred when tryi
相关文章
- How to show location of errors, references to memb
- How to track MongoDB requests from a console appli
- Visual Studio Hangs on Loading UI Library
- How to use Mercurial from Visual Studio 2010?
- Copy different file to output directory for releas
- Edit & Continue doesn't work
- “Csc.exe” exited with code -1073741819
- Visual Studio: Is there an incremental search for
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:
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.
It may not answer the question directly, but, instead of:
Why don't you:
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.
CodeMaid's page lists re-flowing comments among its many code-beautification features.
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.
As I have not found anything suitable so far, I use Vim. I set Open in &Vim as an external tool command, so I can just press
Alt+T,V
to open the current file in it. In Vim, I find the comment (press/
for incremental search), select it (Shift+V
selects whole line) andgq
command formats the selected text. Finally,:wq
and I am back in Visual Studio.Hopefully, some simple extension appears in future or VsVim will get this feature.
The free AtomeerUtils addin mentions such a feature:
I have not tried it.