Wiki Link: [discussion:602]
Future Focus: Document Map Margin  

Coordinator
Aug 13 2008 at 10:36 PM
Please enter your feedback on Document Map Margin here.

Aug 13 2008 at 11:18 PM
I wouldn't use the thumbnail view at all if the option is to simply have it on all the time or not. The thumbnail view is only useful visible all the time with large files; and large files (other than code-gened) is a bad smell to me. The code should be refactored so the files are smaller; rendering a thumbnail view someone pointless.

If 3rd party software like Refactor Pro and Resharper cannot add their existing entries into the margin; I would simply turn it off and use neither this proposed margin nor the thumbnail view.

Honesty, something more useful than the proposed thumbnail view would be a thumbnail that doesn't take a fixed real-estate but is only contextually visible. For example: when I click on the vertical scrollbar thumb a pop-up thumbnail of the document could be displayed with the visible area of the document in a greyed rectangle that is updated in real-time as I move the thumb up and down. It could also become visible when a results window has focus (like Find Results 1 or Error List).

To use that screen real estate all the time would be a waste, and I wouldn't use it.

Aug 14 2008 at 1:10 PM
The "dark gray location window" should be exactly the same size and in exactly the same position as the scrollbar thumb.
So why not integrate the scrollbar with the document map in marker bar view? I know there's not a 1-to-1 mapping where code is outlined/regioned, but I and many others feel that C# regions are such a bad codesmell they shouldn't ordinarily be used, and in practice, outlining is rarely used.

Secondly, Resharper's equivalent of this divides the width of their "marker bar view" in two - allowing multiple errors to be shown for a single line. I find this useful.

Your colors are way too bold. You should tone them down a bit. Resharper's colors are great.

I love the thumbnail view, but I'm concerned about performance for large documents - some of my files are 7000 lines long, having been ported from VB6 and ending up in C#. One of the primary uses for this sort of functionality is to aid refactoring of such unwieldy files. If it is too slow, one of the main use-cases will prove unworkable.

Note that when I've been refactoring these very long (7000 line) files using Resharper, the Resharper "marker bar view" is a solid block of orange - showing static analysis errors totally pervasive throughout the file. Please consider this edge-case scenario when you are developing the feature.

> On longer files, ... text size shrinks vertically (but not horizontally)
So a glyph does not maintain aspect ratio? Does that mean you will get very strange looking documents under certain scenarios?

Finally, what will happen when you split the window horizontally? Will you get a thumbnail view on the left and one on the right? Will users get confused and think that the thumbnail view for the left-hand pane is actually relevant to the right-hand pane? I believe if you integrate these views more with the scrollbar, the visual context will be much clearer.

Aug 14 2008 at 6:30 PM


RichB wrote:
So why not integrate the scrollbar with the document map in marker bar view? I know there's not a 1-to-1 mapping where code is outlined/regioned, but I and many others feel that C# regions are such a bad codesmell they shouldn't ordinarily be used, and in practice, outlining is rarely used.

That's what RockSrcoll does http://www.hanselman.com/blog/IntroducingRockScroll.aspx

The problem with replacing the vertical scrollbar is that you're taking away a know metaphor. Ever other Windows application has a vertical and horizontal scrollbar. If you take away the vertical scrollbar and replace it with this and keep a horizontal scrollbar, you've got two metaphors for the same thing and people will have to learn how to use this new metaphor (i.e. it won't be intuitive, they'll have to spend a few minutes to figure it out).

I can see an option to replace the vertical scrollbar with this; but it shouldn't be on by default.

Aug 15 2008 at 11:55 PM
I think PeterRithcie's first comment is dead on, and I want to reemphasize the need to play well with existing 3rd party marker bar implementations. Ideally 3rd party and Visual Studio marks need to be in the same bar, and some way to avoid 3rd parties and VS "double" marking items is important.

Aug 16 2008 at 12:29 AM

PeterRitchie wrote:


RichB wrote:
So why not integrate the scrollbar with the document map in marker bar view? I know there's not a 1-to-1 mapping where code is outlined/regioned, but I and many others feel that C# regions are such a bad codesmell they shouldn't ordinarily be used, and in practice, outlining is rarely used.

That's what RockSrcoll does http://www.hanselman.com/blog/IntroducingRockScroll.aspx

The problem with replacing the vertical scrollbar is that you're taking away a know metaphor.


I didn't know about RockScroll, but this absolutely isn't what I was thinking. I certainly think the scrollbar should carry on looking more-or-less like a scrollbar. But I don't see why there couldn't be extra markers on it. Or perhaps it could be more like the horizontal scrollbar on the Google Finance Flash-based chart: http://finance.google.com/finance?q=msft - ie something that still resembles a scrollbar, but gives more visual context.

Aug 16 2008 at 2:09 AM
So I'm working on a long file (and all this about too-long files being bad aside, because some of us have long files... maybe I'm working on making it smaller), and I've done a Find-in-Files, and my build is broken (because I'm moving things around), so there are build errors and warnings, and of course I have ReSharper running (and they have upgraded to use the new Document Map).

How do I keep track of all the little tics in the margin?

Don't bother doing this feature if it isn't extensible to third parties, but when I have 3 or 5 different layers of information there, I need a way to quickly filter this. A couple quick ideas:

  • Ensure that there is some extensible list of "Margin Providers"
  • Allow for multiple instances, side-by-side, where I can choose how many instances and which providers go in which (default is a dog-pile).
  • or Have a little drop down checkable list at the top, where I can turn on and off which providers are current.

I think I prefer the multiple instances. At 16 pixels a piece, I can easily afford 3 or 4 of them.


Aug 17 2008 at 6:51 PM
Hi,

Marker Bar view doesn't seem like a useful feature to me. Bookmarking and search result markers are things that I very rarely use, so having a dedicated margin for them would be overkill. Breakpoints have their own tool window already (although I very rarely use that either). Documents aren't typically so large and complex, and usually don't have so many errors, that small red lines in a margin could be useful for locating them. Anyway, we have an error list tool window already that provides much more information as well as quick navigation - and it shows up automatically after a build that has errors and is out of the way while coding.

Thumbnail view might be useful but it's hard to say without having tried it. It also seems to take up a lot of space so a key combo to toggle it on/off would be imperative. I also like Peter Richie's idea of having the view as context-sensitive, possibly only appearing when the scroll bar is activated by the mouse.

I prefer to organize my code so that I know where it's located within the file even before scrolling and without using the code member drop-down lists. I'm the type of person who depends heavily upon visualization to understand things - if I can't "see" it as a whole then I'm confused; i.e., if I were to depend upon a thumbnail view and member drop-down lists to navigate documents then I'd feel extremely uncomfortable working with those documents and I'd certainly take the time to reorganize them. Scrolling provides the quickest and most intuitive way for me to navigate documents when I know where members are located relative to one another.

Currently I use a C# code snippet that generates a set of canonical #region...#endregion divisions. It allows me to visualize where my code is located without having to scroll to see it and without having to use the member drop-down list, making it quick and easy to find code elements and, more importantly, related elements to the element that I'm currently viewing. For example, if I'm looking at a method and I want to move to the definition of a property so that both are in view simultaneously, I simply scroll up and collapse any regions in between the blocks of code that I want to examine. I feel that this conceptual process of navigation is much quicker than attempting to find a block of code, at random, within a thumbnail view.

What would probably be useful to me is a marker bar implementation that marked only the #regions of my code (hierarchical, even better). It should have a button at the top that collapses all code regions in the current document (i.e., Collapse to Definitions) except for the member in which the cursor is currently located and its containing #regions. It should also allow me to click on a marker and have it toggle the expansion of the corresponding #region. This would provide two benefits for me: (1) navigating from one member to another would be quicker than scrolling while manually toggling #regions and (2) there would be less steps involved to getting two specific members visible in the document simultaneously. For the second point I tend to manually collapse all of the regions in between code elements, which is time consuming and annoying when I already know where the elements are located. On that note, it would be great if there was some way that I could quickly express to Visual Studio the members that I want visible; e.g., dragging the left mouse button over an area of the thumbnail view that encapsulates the code that I want to see and having all of the #regions within that area collapsed automatically when the mouse button is released, with the exception of any #regions that contain the member that I clicked and the member that the mouse was over when the button was released.

- Dave

P.S., Please leave my scrollbars alone :)

Aug 18 2008 at 5:45 AM
I like the Thumbnail view. I don't know if just markers would help me much. The thumbnail view should still have the coloring. Rock Scroll sucks. I've installed it and while I don't want to see a lot of my realestate taken away, Rock Scroll thumbnail view is too small and pretty much useless. This version that you are working on is a lot easier to view and has coloring so I think it's much better at least from what I gather when I look at the picture.

Aug 18 2008 at 11:53 AM
I like both the marker view and thumbnail view; hopefully we can get both, and expand from marker view to thumbnail view when required. I would also like to see a "Dirty" mark/highlight in both views so that you can see what you have changed in the file compared with the version saved and/or version in CVS.

Aug 18 2008 at 5:59 PM
Hi.

I like your concept.
Can you highlight the code between brackets when cursor touched one of these brackets?
I'd like to see this feature in your thumbnail view. Because the biggest problem in navigating through the code is differentiating blocks. And can you automate useful features like "optimize using directives"?

Thanks.

Orif

Aug 19 2008 at 12:10 AM
The concepts is great, hence why I love regions…

What I would love to see is the code I actually changed highlighted and the code other changed in a different color. We still want all those resharper features, such as method can be made static, variable missing, etc. The tools needs to be a combination of svn diff tool, resharper all rolled into one. This would solve a couple issues:

1) I can easily see what code I have changed since last checkout.
2) Can easily see what other people are working
2) Makes patching code easier. I know the changes made and can easily takes those and apply them to the patch.

I’m sure developers can think of a million other ideas if we were able to track the metadata about a .cs, .csproj, etc. file.



Aug 19 2008 at 7:30 AM
I think that Marker Bar View the best choice for next generation of Visual Studio! I use Resharper 4.0. This tool consist of some Bar View for code tracking. It is very useful tool.

Aug 19 2008 at 7:03 PM
I actually find no value in this feature. I would actually prefer if Microsoft spent the money on acquiring JetBrains Refactor Pro and adding all of that functionality in VS.Next (for free, of course).

Aug 19 2008 at 8:50 PM

JayTheCTI_Ninja wrote:
I actually find no value in this feature. I would actually prefer if Microsoft spent the money on acquiring JetBrains Refactor Pro and adding all of that functionality in VS.Next (for free, of course).

It is good idea :))!

Aug 20 2008 at 2:00 PM
Good feature!

Aug 20 2008 at 5:47 PM
Could be interesting. Make sure this works fine with regions though.
I don't know if this is the good tool, but a way to quickly jump to regions could be useful.

Aug 20 2008 at 10:57 PM
Marker Bar View contains too little information to justify the effort, IMO.

Thumbnail View is a pretty nice idea. Sometimes a class grows to a very large size outside of your control. If you inherit some code, you may or may not have time to refactor into smaller classes. I crank down the font size in the editor, and despite having to squint on smaller monitors, it gives a better holistic view of the logic. I agree with others, though, that it would be a pity without being customizable by plugging new markers from source control and other tools.

There's another option as well, in addition to (or as a replacement for) Thumbnail View. It would be great to have a list, not of every line of code, but just of the types and members (and their signatures), indented to indicate ownership/nesting levels. This could appear beside the scroll bar, or even in a tool window (taking the place of the Properties window, which is used in designers but no in code view). Support different ways of sorting these items, including alphabetic, by member type and then alphabetic, and most importantly, by the order they appear in the source code. In this last sort order, allow the user to drag and drop types and members and reorder the actual code in the file (with configuration options for dealing with regions. the amount of vertical space to maintain between members, and so on). Doing this would create a "table of contents" for your code. Do you really need to navigate to a specific line of code? I think it would be good enough to find a specific member, double click on that entry to jump there in code, etc. Being able to drag and drop properties and methods to arrange them differently without having to scroll through potentially huge source files would be great.

Aug 24 2008 at 1:41 AM
Edited Aug 24 2008 at 1:42 AM
~~~~ Please combine DMM with the SQL Server 2005 database diagram navigation control. This is the control at the lower right portion of the database diagram screen where the two scroll bars meet and has a "move" cursor symbol. That control, whatever its name is, allows you to navigate the database diagram view by left clicking and dragging the mouse around, effectively moving both scroll bars at the same time. The way DMM is now it only allows vertical jump, but combined with this other control would allow for horizontal jumps too.

Aug 24 2008 at 3:22 PM


JoeyB wrote:
~~~~ Please combine DMM with the SQL Server 2005 database diagram navigation control. This is the control at the lower right portion of the database diagram screen where the two scroll bars meet and has a "move" cursor symbol. That control, whatever its name is, allows you to navigate the database diagram view by left clicking and dragging the mouse around, effectively moving both scroll bars at the same time. The way DMM is now it only allows vertical jump, but combined with this other control would allow for horizontal jumps too.

If you have a three-button mouse, you get this already. Just click the middle button and you can navigate the file by moving the mouse in any direction.

IMO, if your file is so big that navigating in two directions like this is helpful, you've got some serious problems.

Aug 25 2008 at 4:11 PM


mako wrote:

JayTheCTI_Ninja wrote:
I actually find no value in this feature. I would actually prefer if Microsoft spent the money on acquiring JetBrains Refactor Pro and adding all of that functionality in VS.Next (for free, of course).

It is good idea :))!

No. This is a great idea. The implementation by JetBrains in Resharper is outstanding and gives you exactly what you need to see.

Aug 25 2008 at 4:11 PM
Edited Aug 25 2008 at 4:13 PM
Duplicate post.

Aug 25 2008 at 11:36 PM
To be perfectly honest, this is one of those features that looks awesome but after you get your hands on it, you realize instead of helping you out somehow its wasting real estate and you turn it off and forget you can do it.

Given that general overview, the "marker bar" is something I have never seen before in another IDE. That along with VS's excellent ability to pick out spelling errors, coding errors, and such on the fly, would probably be extremely useful. Espeically if I could pick which types of lines show up and which do not. For example, only show the red lines that indicate errors, and the lines that have a "FIXME" on them. That would sexy.

Aug 26 2008 at 12:52 AM
I prefer the thumbnail view. It would be great if the thumbnail could zoom (out/in) to percentages. I loathe regions; <sarcasm>so if you guys could switch out regions for this feature that would be great</sarcasm>! The tooltip highlighting "hidden" code defeats the purpose of putting the code in regions. I am not warm to the idea of having text in code that hides more code and I could also nest hiding code so as to hide more nested code ;)

Aug 26 2008 at 12:55 AM


PeterRitchie wrote:


JoeyB wrote:
~~~~ Please combine DMM with the SQL Server 2005 database diagram navigation control. This is the control at the lower right portion of the database diagram screen where the two scroll bars meet and has a "move" cursor symbol. That control, whatever its name is, allows you to navigate the database diagram view by left clicking and dragging the mouse around, effectively moving both scroll bars at the same time. The way DMM is now it only allows vertical jump, but combined with this other control would allow for horizontal jumps too.

If you have a three-button mouse, you get this already. Just click the middle button and you can navigate the file by moving the mouse in any direction.

IMO, if your file is so big that navigating in two directions like this is helpful, you've got some serious problems.


I think your problem is coasting the forums being negative. You clearly don't write code.

Aug 26 2008 at 1:36 AM
I have been using RockScroll (http://www.hanselman.com/blog/IntroducingRockScroll.aspx) since the day it was released and it works great. I have it to be a great replacement to the standard scroll bar, the only feature that is missing is the ability to scroll line by line and paging but for code this is usually not very necessary (or you can use the keyboard). The only problem I have with RockScroll is that it only works for some file types, and I would like to be able to pick the files. For example, .cs files have it on, but .aspx files do not, I find it to be very useful and would love to have the feature on almost every file. You'd be surprised how quickly you realize the return on setting this up and the initial getting used to it factor. The human brain is just wired to see visual scroll bar with colors much better than a standard scroll bar, simple as that. Navigation becomes very simple when there is a clear structure in the text (as there often is with code) and it definitely is a time saver. Sometimes I find myself using the navigation bar less and less because it is much quicker to do a single click to a location because I know what it looks like versus clicking for drop down, thinking about name, etc. Definitely a must have!!

Aug 28 2008 at 2:11 PM
I use dual monitors at 2048x1536 and usually use two vertical tab groups with 8pt Lucida Console text in VS. I wouldn't want to give up any more horizontal real estate for either of these options. It would be nice if you could quickly toggle the existing Selection and Indicator margins without having to go through Tools | Options.

It would be nice if this was somehow merged with the Class View.

Aug 28 2008 at 3:28 PM
Like few others here I would ask for other functionality but this.
We should try to help people write better and more maintainable code and not give them tools to write bulkier and harder to maintain code.
Working on large files is a classic smell of bad quality code. Let's not help people write 20 page if statements or 100 case switch statements. Let's help them to extract that in files and use design patterns to refactor the mess.
The more tools you give to write messier code the more messier the code will be.

Please spend time to add:
- better refactoring tools
- make the IDE faster and less slugish
- remove pointless modal dialogs with progress bars (why do I have to wait for a Get or Checkin to TFS?)
- make the IDE WORK and respond while you compile and not block
- make it work nicely with dual monitors with stuff like stick to screen borders and different layouts
- allow me to define a build folder for my solution and not fill my hdd with obj and bin folders. For a large solution it takes forever to move the default bin/obj folders
- when I switch files it should be an instant operation. in VS2008 it takes 0.5s to load the fancy Ctrl+Tab window
- make fxcop a low prio background task that can tell me issues while I'm working without eating my cpu
- make the ide pickup all errors on the fly just like ReSharper
- have good contextual refactoring. VS2008 is a joke at refactoring
- make me be in control and have the IDE 100% responsive to ME and the GUI. Everything else is background
- when I move a file in the source control or rename one it should not take 10 seconds to finish the operation
- when I click project properties it should load THEN on 5 seconds later
- oh, PLEASE make every window have a maximize button. Why are there windows that you can resize but not maximize (or don't have a maximize button?)
- (E.g. Add Reference, Undo from TFS...)
- add a fast search/filter to every window (e.g. Properties windows, solution explorer, trees ..) like http://www.acorns.com.au/projects/vsaddins/
- and please please please make the visual studio sln file an simple XML with no GUIDs in it that can be easily merged
I love VS but it's never fast enough.

Aug 28 2008 at 6:45 PM
This is certainly not the worst idea ever, but there are so many MUCH more important things that need to be done in Visual Studio. Take a quick look through Connect and you will see any number of good suggestions which would do more to improve the developer experience than this. Please, listen to your customers and respond to what they are asking for.

Aug 29 2008 at 3:10 PM
Anyone who uses R# knows MarkerBarView is invaluable. Those who don't think it is, most probably have never used it.

Sep 3 2008 at 11:50 PM
(Copied from my comment on the Charlie Calvert's blog... he pointed out it was the wrong place for the many excellent comments people have posted.)

Marker View looks a lot to me like the (rather confusing) compressed view in WinDiff. Thumbnail View looks like exactly what I'd want, as would hopefully include the highlights for breakpoints and bookmarks as well the coloring of #ifdef'd out text. I wouldn't want it to highlight syntax, although comments and string might be a help.

I would be worried about performance hit on updating Thumbnail View (the VS editor isn't exactly the fastest out there as it is). Maybe a hotkey to pop it up?

I would love to have another option: Thumbnail View with Collapse to Definitions always on, but listing breakpoints and bookmarks within the functions:

funcHeader(...) {}

funcHeader(...) {}

funcHeader(...)

{

Bookmark Line

Bookmark Line

}

Maybe with a line or two of context, but I'd be happy without.

That's icing, though. Thumbnail View is great. For Marker View, I just hit the button to cycle through bookmarks or use the breakpoint or error windows.

I am curious, if the Thumbnail View were to be sizeable, would the font resize or would it just show more/less horizontally? How is the size chosen, and is it relative to a fixed width or to the maximum or average width of the content (I'd say the maximum width not over a standard deviation of the average maximum, with 80 cols as a minimum, but who knows?), etc.

So to sum-up:

- Marker Bar View just kind of seems silly to me

- Thumbnail View looks great

- I'm worried about Thumbnail View performance, especially on large changes like running macros, reformatting documents, some refactoring, etc.

- I really, really want Thumbnail View to respect my view preference for whether to use an indicator margin (as an old VC6 user, I hate the indicator margin and still use F2 to cycle bookmarks)

- I don't want to see the Thumbnail View bar get feature creep and gain selection, add/remove bookmarks, highlight current cursor line, etc.

- It would be useful to show the selection in the Thumbnail View, though, should it extend off the screen

- I might (might) like a hover-to-magnify option to help see where a region of text is, but that's definitely icing.

- I can't decide if Thumbnail View should respect the current outlining state or be always expended (or have a separate outlining state whereby anything not on-screen is collapsed with hover-to-expand)

And no matter what, this is great and it's the kind of thinking we need to actually solve the invisible problems we face every day. I have inherited too many 2,000+ line files with messes of unrelated functions (and too much risk to do the much-needed refactoring); I know that the visual shape of the code is the fastest way I get around a large file.

--------------------------------
I want to add something that I've learned recently using RockScroll: please, please, please include a mark as to where the screen is in the document horizontally as well as vertically. RockScroll desn't and when I'm editing files that have a large width (CSV files, some XML, some very strange source files) I would get a lot of value from knowing how far over I am relative to the edges and/or visible file structure.

Oct 22 2009 at 2:04 AM
Ok, I love this, but can somebody please tell me how to enable it in my VS 2010 B2. For the love of this product, I cannot see how to enable/install it!

Nov 6 2010 at 8:22 PM
Looks great, but why hasn't it come out for Visual Studio 2010?

Aug 17 2011 at 8:20 PM
Any word on when this will be available? I really miss Rock Scroll. Thanks!


Updating...
Page view tracker