ReadMe for Comment Reflower

This is a quick & dirty port of Ian Nowland's extremely useful CommentReflower plugin for Visual Studio 2003 and 2005. You can find the original distribution at the Comment Reflower home page.

This port was first cobbled together by Christoph Nahr in June 2008, with several later revisions. I have no connection whatsoever with Ian Nowland and no experience with Visual Studio add-ins either, but since he hasn’t updated Comment Reflower in years I decided to give it a shot. Since I cannot update the original SourceForge project I’ve put my version up for download at my own website.

Important: If Visual Studio refuses to load the add-in, please read my note on automatic execution blocking when unpacking ZIP archives on Windows!

Deployment for Visual Studio 2008

The binary package for Visual Studio 2008 contains an older version of Comment Reflower that was compiled using VS2008. The only difference from a user perspective is that you need to substitute 2008 for 2010 in the file paths shown in the next section.

Deployment for Visual Studio 2010

Comment Reflower supports XCopy deployment. Simply extract the entire contents of the current binary package, CommentReflower.zip, to one of the directories that Visual Studio searches for add-ins. You can find the complete list of supported locations under Tools > Options > Environment > Add-in/Macros Security within Visual Studio 2010. See the MSDN page Visual Studio Add-In Security for further details.

As an example, here is a possible location for a user-specific installation. Substitute your Windows user name for <User> to get the actual directory:

You will find the following files in your deployment folder:

The settings file is not part of the distribution package but will be created the first time you use the Settings dialog. If you have a settings file from an older version of Comment Reflower, you can simply copy it to the deployment folder.

Deployment for Visual Studio 2012

I’m not using Visual Studio 2012 myself, but Shane Tolmie has discovered that Comment Reflower works just fine with that version, provided you update the add-in control file with the new version number. To simplify matters, Comment Reflower now ships with three copies of the add-in control file:

Comment Reflower comes preconfigured for use with Visual Studio 2010. To use Comment Reflower with Visual Studio 2012, adjust the deployment path in the previous section as needed, and then simply overwrite CommentReflower.AddIn with CommentReflower.AddIn-2012.

Changes from the June 2008 Version

All files required to run the add-in are now expected in the same deployment folder, which must be one of the Visual Studio\AddIns folders listed above. This has the following consequences:

If you’re upgrading from the June 2008 version, you will want to copy your existing settings file to the new location. Substituting your user name for <User> and your Visual Studio version number for <Version>, you can find your old settings file at the following location (on Windows Vista):

Changes from the Original Version and Usage Details

The following list shows all projects in the original 2005 distribution and what happened to them in the current source code package, CommentReflowerSource.zip:

The settings file used to reside in LocalUserAppData, then moved to UserAppData in the June 2008 revision, i.e. the “Roaming” version of the same directory; and finally to the AddIns folder in the January 2009 revision.

Some internal names have changed as well. The CommentReflower add-in name is now simply CommentReflower.Connect, with no version suffix such as 2003, 2005, or 2008. Its GUID has changed as well, although it is currently unused. The command names provided by Comment Reflower were shortened and changed to the standard verb form, as follows:

Command Internal Name
Align Parameters at Cursor CommentReflower.Connect.AlignParameters
Reflow Comment at Cursor CommentReflower.Connect.ReflowPoint
Reflow All Comments in Selection CommentReflower.Connect.ReflowSelection
Comment Reflower Settings CommentReflower.Connect.Settings

Each command has a corresponding entry in the Tools menu, and except for Settings also in the context menu of the code editor window. Moreover, each command can be bound to a keyboard shortcut using the Tools: Options: Keyboard dialog. The AlignParameters command is unavailable by default, and must be enabled explicitly using the “Enable Align Params” button in the Settings dialog.

Note: Comment Reflower does not support block comments with non-empty Block Start & Block End fields but an empty (or whitespace) Line Start field, e.g. traditional C-style block comments without leading asterisks on each line. Apparently the comment matching algorithm cannot detect such a combination. Try using the “Empty Block for Text Files” style instead if you require a style without Line Start characters.

Release History