Saturday, January 19, 2013

Announcing the Release of AllMargins for Visual Studio 2012

In August of last year, I wrote about upgrading Visual Studio 2010 extensions so that they will work with Visual Studio 2012. In particular, I discussed upgrading the AllMargins Visual Studio extension, which was quite popular.

For some time now, David Pugh of Microsoft has pulled this extension off of Visual Studio Gallery. It is only available if you happened to have downloaded it and saved it to your hard drive or have downloaded the source code (which you can find the link to in the article I wrote back in August). The problem with the source code is that it's a few versions behind the last release that was available on Visual Studio Gallery and contains a few bugs and is missing support for things like C#'s class initializer syntax.

The extension was pulled because David ported most of the functionality into the Visual Studio Productivity Power Tools. However, I'm not a big fan of the particular implementation of the enhanced scrollbar in VSPPT and prefer the AllMargins scrollbar instead.

Today, I'm announcing general availability once again of the AllMargins 2012 extension on Visual Studio Gallery. I modified the available source code, bringing it up to parity with version 2.6, the last available release on Visual Studio Gallery. In addition, I modified the extension so that it will install in Visual Studio 2012. The extension is now at version 2.7.

Thanks to David Pugh at Microsoft for giving the Visual Studio community this wonderful extension and releasing the source code for it a while back!

As I have time, I hope to make a few additions to the extension. Some planned enhancements include providing the ability to change various colors used for drawing the lines in code files delineating various code blocks or for drawing various markers in the overview margin (e.g. drawing a mark for all occurrences in a document of a word under the cursor in the overview margin) right from the Visual Studio Options dialog.

A few notes about AllMargins 2012. First, because the original extension is linked to David Pugh's Windows Live ID, I had to change the identifier of the extension. (This is good, afterall, you wouldn't want Microsoft to allow people to hijack author's extensions possibly replacing them with malicious code, now would you?!) Since the ID, well, identifies the extension, it's essentially a different extension. So I renamed it AllMargins 2012 while I was at it. What this means is that if you want to use this extension in Visual Studio 2010, you must uninstall David Pugh's original AllMargins extension before installing this extension. I don't know what would happen if you have both installed (Double overview scrollbars? Crash Visual Studio?)

I hope that you will continue to find this extension as useful as I have! The Read Me for the top-level AllMargins 2012 extension is presented below.

AllMargins 2012

    This is a compilation of the OverviewMargin and several other extensions that use the OverviewMargin. The OverviewMargin shows
    a margin on the right side of the editor that logically maps to the entire file (similar the the vertical scroll bar). Unlike
    the scroll bar, it maps to the entire file and can contain other margins that provide more information about the file.

Included extensions:

        BlockTagger         The definition of an API to get the structure of a code file.
        BlockTaggerImpl     An implementation of the BlockTaggerAPI for C/C# and VB files.

        OverviewMargin      The definition of an API for creating margins that map to the entire file.

        SettingsStore       The definition of an API to load and save editor options across sessions.
        SettingsStoreImpl   An implementation of the SettingStore API that uses IVsSettingsStore to access the system registry.

    See other extensions.


The full source for this extension is at
The source code is not yet available for download.

    v1.0    David Pugh  2/26/2010
        Initial release
    V1.1    David Pugh  3/4/2010
        Updated included extensions.
    V1.2    David Pugh  4/19/2010
        Updated included extensions.
    V1.3    David Pugh  4/20/2010
        Updated included extensions.
    V1.4    David Pugh  4/22/2010
        Updated included extensions.
    V1.5    David Pugh  4/27/2010
        Updated included extensions.
    V1.6    David Pugh  4/28/2010
        Updated included extensions to fix VB parser error.
    V1.7    David Pugh  4/28/2010
        Updated version number to work around install issue.
    V1.8    David Pugh  4/28/2010
        More VB parse fixes (Public, REM, Interface, Structure).
    V1.9    David Pugh  4/28/2010
        Updated CaretMargin, VB, C# and C parsers.
    V2.0    David Pugh  5/03/2010
        Bumped version number to fix installation problem.
    V2.1    David Pugh  6/10/2010
        Updated OverviewMargin, BlockTagger, StructureAdornment & StructureMargin.
        Changed namespaces and DLL names to Microsoft.VisualStudio.Extensions.....
    V2.2    David Pugh  6/29/2010
        Updated StructureAdornment.
    V2.3    David Pugh  6/30/2010
        Picked up fix for VB parser, tweaks for structure adornment & margin.
    V2.4    David Pugh  7/08/2010
        Updated StructureAdornment.
    V2.5    David Pugh  7/12/2010
        Updated included BlockTaggerImpl to handle C/C# array initializers.
    V2.6    David Pugh  7/31/2010
        Updated included CaretMargin to fix problem with margin not updating correctly.
        Updated included OverviewMarginImpl to fix scrollbar mapping problem.
    V2.7 Craig E. Shea 1/16/2013
        Added Visual Studio 2012 support.
        Removed the attribute MaxVersion="4.0" on the SupportedFrameworkRuntimeEdition element.
        Changed the author and description to indicate who is now responsible for the extension and that it is a re-release of a previously available extension.


  1. Dear Craig.
    Although I love your extension, I noticed that every update resets the settings, which is a pain, when there is no settings-menu, but just registry entries.

  2. I'm glad you like the extension. I'm sorry you're having problems with the settings being reset. There are four possible reasons this has occurred, of which two may both be applicable, or one of the other. First, if you are a previous user of AllMargins (David Pugh's original extension), installing AllMargins2012 may have overwritten the old settings. This is not easily avoided. Secondly, if you just upgraded to 2.8.x, the setting names all changed from prior versions due to name clashes with the Visual Studio Productivity Power Tools 2012 (see the extension page at VS Gallery for more info)--this was anticipated to occur. Thirdly, if you installed the VSPPT after AllMargins 2012 v2.7, due to the name clashes mentioned, the VSPPT may have reset the values. Then updating to v2.8 created new setting value names (but the old settings are still in the registry, they're just not used by AllMargins 2012 anymore). If none of these has occurred (e.g. You installed 1.8, changed settings, installed 2.8.1 and the settings reverted to default), I will need to look into this--so I'd like to hear back from you if any of the above does not match your situation. Finally, the original AllMargins never had a Tools|Option page settings in VS--probably the original author never got time. This is a top priority for the next release of this extension. I hope to release this in a few weeks. Please get back to me about this possible settings issue. If there's a bug, I want to squash it 😊.