fsprojects-archive / zzarchive-VisualFSharpPowerTools

[ARCHIVED] Power commands for F# in Visual Studio
http://fsprojects.github.io/VisualFSharpPowerTools/
Apache License 2.0
310 stars 77 forks source link

Add "breandcrumbs" bar #1446

Closed vasily-kirichenko closed 7 years ago

vasily-kirichenko commented 8 years ago

Last release of IntelliJ IDEA added new "Breadcrumbs" toolbar:

1

If you click on a symbol on the toolbar, the cursor jumps to that symbol. If you click on a symbol with right mouse button, the whole entity definition is selected. When you hover over a symbol on the toolbar, it shows its type and, for lambdas, the whole definition.

It's similar to Xamarin's navigation bar, but without ability to select other symbols with comboboxes. I'm not sure which style is better though. If we are gonna to resurrect VFT's Navigation bar, then it makes sense to rewrite it to mimic Xamarin's behavior.

smoothdeveloper commented 8 years ago

If each item could be a dropdown, and the first item is the list of modules/namespaces in the project, that would be killer feature :)

vasily-kirichenko commented 8 years ago

As I said, dropdowns makes it a different thing, you cannot click / right click on them to go-to-symbol / select definition with them.

smoothdeveloper commented 8 years ago

having a part with the text (breadcrumb) and a part with dropdown (the down arrow) would bring best of both worlds.

The underlying service which keeps track of hierarchy of node would be useful for other features as well, I intend to implement solution explorer tree nodes under .fs files at some point.

cloudRoutine commented 8 years ago

@vasily-kirichenko it's possible to make a WPF control that allows both, it doesn't have to be the kind used in the current navigation bar

vasily-kirichenko commented 8 years ago

OK!

JohanLarsson commented 8 years ago

When is this useful? For selecting code?

vasily-kirichenko commented 8 years ago

@JohanLarsson The main feature - instant understanding where you are in a large file, I mean in what module, type, method or function the cursor is.

cloudRoutine commented 8 years ago

@JohanLarsson this would be really useful, especially when working through unfamiliar source

@vasily-kirichenko should we do the same kind of preview windows that we use for collapsed outlined regions, or should we have intellisense tooltips pop up on hover instead?

JohanLarsson commented 8 years ago

Wrote a prototype for the UI. animation

The control is an ItemsControl bound to a collection of nodes where each node has Children and a SelectedChild. This way it supports arbitrary depth and content.

We need to write a viewmodel that exposes the ast and cursor position like this, probably pretty straightforward.

vasily-kirichenko commented 8 years ago

Could you port it to F# and make it a margin, similar to QuickInfoPanel?

cloudRoutine commented 8 years ago

There's no need for the nodes to be drop down menus, there's only ever one path down the AST to the current scope depth at the cursor position

vasily-kirichenko commented 8 years ago

I agree. We should not mix navbar with this feature.

JohanLarsson commented 8 years ago

@vasily-kirichenko everything can be ported to f# given enough time and skill :) I'll have to figure out what a margin is, have not used the VS API much. I'll create a throw away VS extension and try to figure it out.

@cloudRoutine dropping the dropdowns will simplify things a lot. Without having used f# much I think I agree with @smoothdeveloper that they can be useful. Maybe best to start simple without them.

About mixing features: screen space is a limited resource, if the ux can be made to make sense mixing could be a good thing.

Another questions is what should be on each level [namespaces, modules, types, lets] and probably a bunch of scary things that I don't know about. Levels will probably be mixed, wpf will probably handle that nicely with templates.

JohanLarsson commented 8 years ago

image

@vasily-kirichenko Is ^ how you want it?

vasily-kirichenko commented 8 years ago

Yeah, but on gray background. Also, each type of symbol should be colored differently.

JohanLarsson commented 8 years ago

Leftaligning it with the text is somewhat tricky, is it better than: image ^ is simpler.

About the background: should probably be set by dynamicresource to a resourcekey to make it theme aware.

About styling content: the sky is not the limit.

vasily-kirichenko commented 8 years ago

It should be left aligned with text, as on the previous screenshot.

The font should be the same as one used for code in editor.

Colors should be calm.

JohanLarsson commented 8 years ago

+1 about font And I think maybe no colours at all, perhaps light up on mouseover or an underline with colour. Text only will probably go a long way. Making UI like a christmastree is not always awesome ux.

smoothdeveloper commented 8 years ago

Regarding colors / background, I believe we should use the semantic coloring used in the source code itself, modules have some color, mutable variables some color, interfaces some color etc.

JohanLarsson commented 8 years ago

That makes sense, maybe just use foreground on the text.

vasily-kirichenko commented 7 years ago

It turns out this feature is more annoying than useful.