Scott Hanselman

Introducing RockScroll

May 9, '08 Comments [64] Posted in Musings | Tools
Sponsored By

When I came to Microsoft I saw a really cool tool being used internally and immediately wanted to work with the author, Rocky Downs (who is blogless, but exceeding talented), to get it released. Fast forward to now, plus an installer, and here it is.

The basic (as in "only") idea is that RockScroll extends the scrollbar in Visual Studio to show a syntax highlighted thumbnail view of your source. This is really useful for those excessively long source code files you know you have. It's just one DLL and you can turn it off from Tools|AddIns just by un-checking the checkbox.

Enjoy!

RockScroll

works-on-my-machine-starburst Works On My Machine Disclaimer: This is released with exactly zero warranty or support. If it deletes files or kills your family pet, you have been warned. It might work great, and it might not. It hasn't been tested against the myriad of other VS Add-Ins, but it works on my machine in both VS2005 and VS2008. It does look a little odd next to Resharper, a tool that also adds a scrollbar. Good luck.

A reader, Hans, says: "I have found that (not suprisingly) RockScroll works very well with split windows, if you bind a shortcut key to the "Window.Split" command." for those of you having trouble with split windows.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Sponsored By
Hosting By
Dedicated Windows Server Hosting by ORCS Web
Friday, May 09, 2008 9:34:45 PM UTC
Wow.... that's great...
It can be of great help on the project where I'm now, with 350Kb and 10k lines code files :)
I can also act as stress test for the tool :)
Will test it next Monday...
Friday, May 09, 2008 9:41:03 PM UTC
"Works on my machine" as well, however it doesn't play nicely with collapsed code sections. It doesn't break or anything, it just doesn't reflect your position accurately. It also doesn't work with aspx files.

Still, definetly worth trying out for a bit of time.
Tom
Friday, May 09, 2008 9:48:19 PM UTC
It does more than advertised: doubleclick a word and it will highlight in purple everywhere that word is used, and block-red everywhere in the scrollbar. It's a simple find/highlight - not matching whole words or anything, but a nice unadvertised feature. (You can double click a semi-colon actually)
Tom
Friday, May 09, 2008 9:51:31 PM UTC
I saw the same thing as Tom, which is rather unfortunate since I use regions quite a bit to isolate the code I care about from the everything else. I don't suppose this nice little add-in will be released to the community so these minor issues can be fixed?
Darrell
Friday, May 09, 2008 9:56:14 PM UTC
WOW, what a fantastic idea! The only thing I noticed is that it does not apply for ASPX files. Just the cs files.. Maybe in future releases it'll also include web forms.

Thanks for showing this off.. It's awesome!
Brad C.
Friday, May 09, 2008 9:56:15 PM UTC
There's a downside that I don't see mentioned here.

Some folk may take this as making it easier to keep writing unwieldy, unmaintainable, spagetti code. I'm sure that's not Rocky's intent, but it may be an unintended side-effect. Shouldn't it be painful to write bad code?
Friday, May 09, 2008 10:02:59 PM UTC
At first I thought - would i use that? Then I suddenly thought it maybe really useful for javascript files where the old goto definition doesn't work.... unfortunatly the tool only seems to work with .net code files.

Support for all file types would be great. Anyway I'll give it go, thanks for the link.
Friday, May 09, 2008 10:08:16 PM UTC
Very cool, indeed. Also works on my machine.

@kevwil-It's easy enough to write crap code as is. I don't see this making it easier.

My only (admittedly trivial) gripe is that you can't set the highlighter colors for it different from what's used in the actual code window (I code in mainly White on Black text, which comes out a little monochrome in the scroll bar).

Another unadvertised feature. It draws a little red box for every breakpoint that's set.

I'd love to see the source for this bad boy<hint - hint> Maybe you could lean on Rocky?
Darin
Friday, May 09, 2008 10:24:09 PM UTC
I would like to see support for other files typs like js, css, and aspx. Very cool tool. Thanks for the post.
Friday, May 09, 2008 10:29:36 PM UTC
Nice utility for dealing with ugly large files. As others pointed out, not working nice with collapsed code is sort of a bummer but hey it's free.
Friday, May 09, 2008 10:36:10 PM UTC
After installing it, my cat died! ;-)
Friday, May 09, 2008 10:45:26 PM UTC
The tool is great, the only issue is that it disregards regions. It only works good if it all outlining is set to 'toggle all'
Friday, May 09, 2008 11:00:31 PM UTC
I confirm that it works on Microsoft Visual Studio 2008 RTM. It's a great tool! Love it..
Friday, May 09, 2008 11:05:52 PM UTC
Great tool Scott. Thanks for sharing!

Thanks also to Rocky Downs for writing it.

-- Stu
Friday, May 09, 2008 11:23:40 PM UTC
Its an awesome addin but he lack of region support is a deal breaker for me. Still, it's a great concept! I hope that Rocky will continue working on it or release it on Codeplex so we can work to improve it.
Saturday, May 10, 2008 2:54:37 AM UTC
Works for me. I don't have R# installed on this machine, and I'm wondering if the two play well together since R# uses the VS.NET scrollbars. Anyone tried it?
Saturday, May 10, 2008 3:26:51 AM UTC
the cat dying comment made my day.
looks like a fun tool
Saturday, May 10, 2008 3:31:44 AM UTC
This is fantastic - a similar idea exists in KDIFF3 and I love it!
Saturday, May 10, 2008 3:56:40 AM UTC
Works on my machine running VS 2005. But, it doesn't show syntax coloring if you have customized look and feel of your VS.

Another issue is that, if you want to turn it off using Tools|AddIns..., it doesn't remove untill you close the code file. In general, it may be a good utility for those, who does not organize their code in regions.
Saturday, May 10, 2008 4:01:59 AM UTC
Scott,
Pointing the link on image to the installer download is very confusing. I clicked on the image thinking that it will show the enlarged image and It displayed download dialog. This looks like cheap marketing stretegy. And you are not marketing RockScroll, are you :).
Saturday, May 10, 2008 4:31:36 AM UTC
I want to thank Scott for showcasing my tool. I am glad many are finding it interesting.

I use this add-in as my Visual Studio scrollbar. I find it useful for large and small files. The double click – instant find in file is my favorite feature. I end up double clicking on identifiers often when I am debugging or refactoring code. Many times I use the double click to do a find in file rather than using find all references or go-to definition. You can clear a find in file by right clicking in the scrollbar.

Breakpoints and bookmarks are visualized in the right side of the scrollbar. Recent edits are visualized on the left size (orange for unsaved changes and blue for saved changes).

In the scrollbar C++ and C# single line comments are colored green. Other comment syntax is not recognized now.

To address some concerns mentioned above:

XML type files are not supported. There are several file extensions that fall into this type. The reason for this is to keep Rockscroll out of the resource editor. If you really want to use a certain file type with Rockscroll you can either change the extension or dissociate that extension with that document type in VS. (I am at home right now and do not have the latest tools at home, but it is something like:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Editors\{C76D83F8-A489-11D0-8195-00A0C91BBEE3}\Extensions )

I would like to support outlining at some point. As others have noted, the scrollbar gets out of sync when there are collapsed nodes. Personal preferences vary, but I find the scrollbar with its single click navigation and visualizations to give me a workflow that competes with outlining.

All colors are currently hardcoded. I would like to hook it up to the VS fonts and colors at some point. The width is hardcoded as well. I always wanted to make the width dynamic so you could drag it out wider if needed.

I will look into a codeplex project in the future. The major current item holding me back is that this tool is really hard to build. This tool does not use any private interfaces or APIs, but some of COM interfaces I use are being pulled in through internal source files. So, I would need to divorce myself from those files first. Also, it would possibly require VSIP to build.

Thanks,
Rocky
Rocky Downs
Saturday, May 10, 2008 4:46:21 AM UTC
Cool idea, but doesn't support collapsed code sections; not usable for me in its current form.
Saturday, May 10, 2008 5:35:47 AM UTC
Yanesh - It wasn't intended to be a marketing strategy, considering that it's FREE. ;) I was just trying to make it easy to download as I'm always hunting for the download button when I see free tools. I'll change it if it bothers you.
Saturday, May 10, 2008 5:37:53 AM UTC
I'm totally surprised at all the folks who used code regions. I just don't. I'm amazing. I tend to use more, smaller files, rather than something really long with lots of regions. I think that if you have that many regions it might be time to refactor? ;)
Saturday, May 10, 2008 7:14:58 AM UTC
Rocky and Scott -- this is awesome! Thanks for sharing it!
Saturday, May 10, 2008 7:16:18 AM UTC
And for the record, I am also in the "regions suck" camp. #region is like GOTOs -- useful in controlled circumstances if you know what you're doing, but generally abused.
Saturday, May 10, 2008 9:33:00 AM UTC
About the add-in: This is one of the coolest and most useful add-ins I've seen. Tell Rocky that he ROCKS!

About the code region part: In a perfect world - where you work with good specifications and people that know what they are doing - code regions should not exist. Alas, in the real world were you work on projects with tight deadlines and many people that are geographically separated, code regions may be the last resort to make ugly, bad code readable. Sad but true.
Saturday, May 10, 2008 11:43:27 AM UTC
Is it possible to increase width of scrollbar? perhaps in registry?
Saturday, May 10, 2008 12:57:55 PM UTC
Thanks for sharing this. Love it. But what I really don't like about this tool is that it takes away my default scroll bar. I want the default scroll bar to stay and this thing to work "with" the default scroll bar rather than replacing the default scroll bar. Rocky should use "Rored" a RoR editor to get inspired. Rored does the exact same thing very elegantly by leaving the default scroll bar intact. And yes, it doesn't show syntax coloring if you have customized look and feel of your visual studio.

Again, thanks for sharing this. Love it!
Saturday, May 10, 2008 12:59:40 PM UTC
Thanks for sharing this. Love it. However, What I really don't like about this tool is that it takes away my default scroll bar. I want the default scroll bar to stay and this thing to work "with" the default scroll bar rather than replacing the default scroll bar. Rocky should use "Rored" a RoR editor to get inspired. Rored does the exact same thing very elegantly by leaving the default scroll bar intact. And yes, it doesn't show syntax coloring if you have customized look and feel of your visual studio.

Again, thanks for sharing this. Love it!
Saturday, May 10, 2008 8:40:16 PM UTC
I have installed it and I have came back here and double clicked "css" to see if others are using it for browsing css. But nothing appeared on right side of screen! Such an addictive tool!

Very thanks for sharing!
Kaveh Shahbazian
Saturday, May 10, 2008 10:09:53 PM UTC
Regions Suck? I was wondering if anybody else but me thought that.

Nice to know I've got some company out there.

What is it with this technique of putting every dang method/property in a region anyway?

Maybe I've just become "an old coot"<g>
Darin
Sunday, May 11, 2008 7:22:21 AM UTC
Awww sweet!

Would really love to see the source code for this one.

Thanks guys.
Sunday, May 11, 2008 7:56:37 AM UTC
Scott, I decorate each an every class with regions ("fields", "properties", etc), so the length of the code file has nothing to do with regions use.
Kevin, I don't like someone forcing me to do the "right thing", as I would rather have the choice myself.
Sunday, May 11, 2008 8:25:48 AM UTC
Scott, I decorate each and every class with regions ("fields", "properties", etc), so the length of the code file has nothing to do with regions use.
Kevin, I don't like someone forcing me to do the "right thing", as I would rather have the choice myself.
Sunday, May 11, 2008 5:03:51 PM UTC
<troll>People who prefer the verbosity of regions should switch to VB.</troll>

Nice tool. There are a few repainting issues at times, especially with Resharper installed. Otherwise it's great!
AC
Sunday, May 11, 2008 7:29:35 PM UTC
Awesome tool, great find, but add me to the list of kids wishing for region support. I use Regions to "hide" the verbosity of necessarily verbose things, like WPF DependencyProperty definitions (and their myraid of callbacks).
Monday, May 12, 2008 1:07:35 AM UTC
Hey Rocky, nice work! Unfortunately it appears that it doesn't play nicely with Visual Assist, meaning that I've unfortunately had to uninstall it. No idea if you plan on supporting the tool further, but VA interoperability would be great.

Mark.
Monday, May 12, 2008 1:09:02 AM UTC
Wicked tool. Seems a little odd at first to be missing one of the "core" features, the vertical scroll bar. But I'm used to it by now.

It'd be nice if it supported VB comments. I'm one of those evil VB developers :) Even without the comments though, it's mad useful for finding "arrow code". And getting some kind of extra spatial sense of where I am in a code file is fab. Good job Rocky
Dan F
Monday, May 12, 2008 9:56:38 AM UTC
Hi Rocky and Scott,

this is really a great tool! It's one of those simple but extremely good ideas, my congratulations!
I would suggest, you divorce yourself from the COM-components if you have the time. Bringing the project to codeplex would make many people happy (me included). There are definitely points that have to be in control of the user to make it THE tool, but hey, that's what the tool will converge to at codeplex.

I will definitely recommend it to my colleagues and friends!

@Scott: Please let us know, which way the tool will go!

Regards,
Dennis
Dennis
Monday, May 12, 2008 11:24:35 AM UTC
Before I can use this at work...
...Regions need to be supported (I like them when used consistently)
...I would also like my default Scrollbar to remain (perhaps make this an option)
...I would like vb syntax highlighting

Otherwise, quite nice. More and more people seem to be making use of the scrollbar area.
For example Coderush's Beta feature - Code Analysis (Code Issues)

Good stuff. I will be interested in any follow up information of the development of this addin.
Monday, May 12, 2008 2:32:30 PM UTC
1. FeelingTheLove++
2. RegionsSuck++
3. Works ok with R#, but the display is a little funky. Passable though.

Suggestion: put it in a pane, so that its undockable, hide able, pin able, etc.
Monday, May 12, 2008 3:29:12 PM UTC
Wonderful addin, thank you very much.
Monday, May 12, 2008 7:19:35 PM UTC
Hi,

I like the idea.

But I had to uninstall it because it doesn't work with split screens. The option is removed.

Eric
Eric Schatzschneider
Tuesday, May 13, 2008 3:25:30 PM UTC
Doesn't play well with Coderush since it uses the scroll bars, the SB area kinda covers the greeking proxy, you have to split the code window to get the full proxy view.

A question for Rocky, how are you getting the greeked text representation? Just a bitmap of the editor region and scaling it down or somthing cooler?

Thanks for the tool!
Adam Hill
Tuesday, May 13, 2008 4:57:58 PM UTC
A little off topic, but, Sott, you're not using CodeRush anymore? Is there any particular advantage you've found on Resharper over CodeRush?


Julio
Tuesday, May 13, 2008 5:56:47 PM UTC
Sounds awesome - too bad it doesn't work with .js files. (Not sure why those would be considered an 'XML' file?)
Wednesday, May 14, 2008 5:30:48 PM UTC
Works on my machine too. However if you have word wrap on (someone previous to me wrote long lines of code) the sync is a little off. This was tested by turning word wrap off and then the scroll is in sync with the editor.
Kurt Place
Wednesday, May 14, 2008 10:18:48 PM UTC
Excellent tool! Thanks, Rocky.

I sometimes use regions, depends on the project. I often use the internal "non region" method collapser. The navigation of large files in VS leaves a lot to be desired and this tool goes a long way towards fixing it.
Zyxil
Thursday, May 15, 2008 2:19:33 AM UTC
The little spliiter rectangle that normally lives directly above the scroll bar is gone :( Would be nice to be able to split view the current document with RockScroll installed.
Friday, May 16, 2008 6:31:37 AM UTC
"(who is blogless, but exceeding talented)"

What do you mean by this?
The exceeding people always have blogs?
blogs makes you a better professional?

Don't take me in the wrong way, I love to read your blog.
Just that comment was strange ;)

Joo
Friday, May 16, 2008 7:22:13 AM UTC
Joo - Not really. Everytime I mention a person and DON'T link to their blog, someone says something. "Where's their blog?" "What? No Link?" So this time I was trying to explain the lack of link. ;)
Friday, May 16, 2008 8:33:03 AM UTC
Cool Tool! Simple idea brings great convenience for programmer.
Though it is a little confusing when there are collapsed region in editor area. Hope this can be fixed soon.
Monday, May 19, 2008 1:51:44 AM UTC
It didn't kill my cat, but it did seem to cause a long freeze after every build (successful or unsuccessful) when working on a large solution with embarrassingly long source files.
Monday, May 19, 2008 7:43:34 PM UTC
Like it a lot. I definitely need JS support, since those are the most unweidly of files in my current project.
Matt Fraser
Tuesday, May 20, 2008 3:01:52 AM UTC
I must be missing something obvious: how do you scroll by a single line (a'la clicking the arrow buttons of the regular scroller)?
Thursday, May 22, 2008 3:21:31 PM UTC
This is a very cool idea, and a good start, but the lack of support for collapsible regions is a deal breaker. If it worked accurately with collapsed regions, I would definitely leave this add-in turned on.
Friday, May 23, 2008 3:30:44 AM UTC
Awesome! Thanks for sharing and for convincing Rocky to release this. Nice work Rocky!

I too am baffled by the region usage - I worked w/ someone that used them a LOT and it was quite disturbing since he insisted on collapsing the region we were looking at before moving on to look at other code.

Add another plea for a codeplex release.

John
jschroedl
Sunday, May 25, 2008 12:45:18 PM UTC
The more I use it, the more I like it!!

I'm getting the occasional crash with RockScroll. I have submitted the crash report through the automated tool.

It seems that when closing a file, RockScroll can become confused.

Even if you don't open the source, Rocky, you might wish to find a home for it so you can organize feedback and releases.

Thanks, again,
John
Zyxil
Thursday, May 29, 2008 3:23:17 PM UTC
Ok, I've used it for a week and LOVE rockscroll.

Can we PLEASE have a regkey to set an RGB color for the double-click highlight color? Pretty please!!? Did I mention I love it?

John
Monday, June 09, 2008 7:47:36 PM UTC
Hi , this tool is awesome!!! Works on my machine perfectly.
Diego Toala
Wednesday, June 18, 2008 7:52:14 AM UTC
I gotta say i really like the idea, sadly i think it still has too many kinks to really be usefull. It would be nice if some extra development time could be thrown at it to make it more stable.

The region issue is also a problem for me. I agree that regions should not be misused, but sometimes they are just nice so i can avoid seeing the same boilerplace code and having to scroll through it all the time.

Besides the region issue some files just make the scrollbar go crazy, so it shows icons for pinning windows, or other random content from my screen. When this happens i cant scroll at all and end up having to use pageup to navigate :(
Christian Nielsen
Thursday, June 26, 2008 12:07:03 PM UTC
Region support would be great...and really it isn't even region support. Any methods in a code-behind can be collapsed, and occasionally I choose to do this. If this toolbar supported that, it would be even more awesome! Either way, it's a creative solution that probably wasn't meant for public consumption. I really appreciate the effort that has already been put into this project. Thanks!
Steve
Tuesday, July 08, 2008 3:46:18 AM UTC
Still can't get enough of Rockscroll!!

Wish EVERYTHING had rockscroll!!

Word documents. Web pages. Emails. Disk drives. Movies. Books.

Rockscroll!!! ROOOOCCCCCCKKKKKKK SCROLLLLLLLLLLLLLL!!!!
Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.