The Forums Are Now Closed!

The content will remain as a historical reference, thank you.

MetalMargin - MetalScroll for Visual Studio 2010

By on October 2, 2011 11:45:15 AM from JoeUser Forums JoeUser ForumsExternal Link

Having just recently transitioned to Visual Studio 2010 (finally) at my day job, I found myself in a bit of a predicament.

Previously we'd been using VS2005, for which there was a little extension called MetalScroll (based on another named RockScroll); this extension changed the scrollbar into an actual thumbnail of the code in the editor. For very large and complex files, this makes navigation considerably easier and quicker because you can learn the code's physical layout and identify important locations in the code by sight.

Unfortunately, as of VS2010 all extensions have to use WPF; MetalScroll was a Win32 extension and the author had no interest in rewriting it for the new version.

There are some other scrollbar replacements available for VS2010 (AllMargins by David Pugh, and the modified version of it which is included in Microsoft's Productivity Power Tools for VS2010).

 

StructureMargin

 

These have some nice new features, like showing a code preview tip window when you hover your cursor over the scrollbar, but none of them quite stack up to MetalScroll as far as navigation goes. AllMargins's included StructureMargin extension just shows an abstracted representation of code blocks and regions, while PPT's "full map" mode only renders every Nth line in large files, so the scrollbar image is not at all representative of the actual code layout.

Fortunately, while the source is not available for the improved version of StructureMargin that is included in PPT, the original one from AllMargins is. So this weekend, I decided to try my hand at tearing it down and rebuilding it into something approximating MetalScroll as closely as possible. Here's the result:

 

MetalMargin

 

I call it MetalMargin (very creative eh?). It retains some of the features from AllMargins that I liked (the code preview on mouseover), while removing and rewriting the abstract structure view into a direct physical preview, which uses your own VS color settings to draw the thumbnail.

It's available here if you're interested in giving it a try. I haven't tested it anywhere other than my home machine yet, so if you have a "clean" VS2010 environment which has not had 2005/2008 installed also, you may be missing some dependencies. YMMV

 

+376 Karma | 10 Replies
October 19, 2011 4:31:41 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Excellent, love your work so far! The closer to MetalScroll the better.

 

Bugs/requests:

- when installing MetalMargin, if CaretMargin, OverviewMargin etc. are already installed then the installer just says "Installation failed"

- I miss the MetalScroll feature to only highlight a word when double clicking it instead of single clicking

- it would be awesome to be able to change the color of the highlighted word in the text, right now it's very similar to my blue background color

 

Thanks, and keep it up! I will recommend this extension to all my coding colleges.

October 19, 2011 8:31:12 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Quoting HubertCumberdale,
when installing MetalMargin, if CaretMargin, OverviewMargin etc. are already installed then the installer just says "Installation failed"

I believe that's a limitation of the VSIX installer (it won't install over existing copies of the same version).

 

- it would be awesome to be able to change the color of the highlighted word in the text, right now it's very similar to my blue background color

This can be done in the registry (the AdornmentMatchColor setting, IIRC), just edit the included file and re-merge it. AllMargins didn't have a VS options screen of its own, but that's on the to-do list.

October 21, 2011 9:35:17 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Genius!

I love this, please keep working on that. Most important thing to add IMO is an option to make doubleclick highlight a word, not singleclick as now (as the previous poster indicated).

If this takes off, you will have thousands of people downloading it and thanking you for that. So far IMO there has been no viable replacement of Metalscroll for VS2010. Productivity extensions were the best try, but they fall waaaay short.

Other things I'd love added (apart from doubleclick highlighting - this by way most important for me):

- Ability to change highlight color without tweaking the registry

- Better rendering of text in scrollbar (not just meaningless fat lines but the real thing downscaled)

- Display of highlighted item inline in text in scrollbar

 

October 30, 2011 11:26:39 AM from Elemental Forums Elemental Forums

New version now available here. Refactored everything into just one vsix so it doesn't have install conflicts with AllMargins, and added in the options screen for all of the colors that are not pulled from the VS text color options already, as well as some configurations for the thumb (toggle the different colors on or off and configure which keywords get colored). An option for double click caret highlight is there but remains NYI for the time being.

November 5, 2011 2:11:26 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Nice, keep up the good work!

December 14, 2011 5:05:57 AM from GUIChamps Forums GUIChamps Forums

My top request (apart from the NYI double click feature): show breakpoints and bookmarks in the margin.

Cheers.

February 8, 2012 4:22:40 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Just wondering, how do you remove this from VS? There doesn't seeem to be an easy way of doing so.

Great work BTW.

February 8, 2012 6:54:07 AM from Stardock Forums Stardock Forums

It can be uninstalled from the Extension Manager in VS2010, same as any other extension.

February 8, 2012 7:50:18 AM from WinCustomize Forums WinCustomize Forums

 My question is ... what exactly is it used for? I'm totally ignorant when it comes to this sort of thing.

February 13, 2012 5:18:22 AM from GUIChamps Forums GUIChamps Forums

Just read the presentation at the top..? For large source code files it's really really useful to get an overview of the code and to see where in the code a certain variable is used without having to search.

 

Can't wait for the next version, keep it up kryo!

 

Stardock Forums v1.0.0.0    #108435  walnut2   Server Load Time: 00:00:00.0001032   Page Render Time:

Stardock Magazine | Register | Online Privacy Policy | Terms of Use

Copyright ?? 2012 Stardock Entertainment and Gas Powered Games. Demigod is a trademark of Gas Powered Games. All rights reserved. All other trademarks and copyrights are the properties of their respective owners. Windows, the Windows Vista Start button and Xbox 360 are trademarks of the Microsoft group of companies, and 'Games for Windows' and the Windows Vista Start button logo are used under license from Microsoft. ?? 2012 Advanced Micro Devices, Inc. All rights reserved. AMD, the AMD Arrow logo and combinations thereof are trademarks of Advanced Micro Devices, Inc.