8.0 Feature Request: Go To Everything w/ Context

There's a feature I've desperately wanted to see in Resharper for a bit, I've just not found the time to implement it in a plugin, so I wanted to suggest it here because it fits pretty well with the Go To Everything feature mentioned on the blog post announcing 8.0, so while you guys are in there working on that, I really hope you can find some time to add this:

The basic gist is this:

When the "Go To Everything" window is opened, use whatever file I currently have open as context instead of showing me a blank textbox and no suggestions in the list.  I think of it as a "Go To Related" feature.  75% of the time, when I open the Go To Type window, I'm searching for a type related to the one I currently have open.  For instance, let's take the following solution structure as an example:

Domain Project
- Entity
- User : Entity

Data Access Project
- EntityRepository<TEntity>
- UserRepository : EntityRepository<User>

Service Project
- EntityService<TEntity, TRepository>
- UserService : EntityService<User, UserRepository>

When I invoke the "Go To Everything" command, show the empty search box, but instead of not showing a list, show me types to whatever class I'm looking at.  The list would be sorted based on strength of relationship, so prioritize it by something like:

1) Base and Derived types show up at the top of the list (Maybe just the immediate base and immediately derived?)
2) After that, types that have a generic argument with a generic type constraint of my current type, or that pass this type as a generic type to a base type show up
3) After that, types that have a constructor/method/property that takes the type as a parameter, or returns an instance of that type

With these rules, let's say I have the User class open and invoke the Go To Everything command.  The text box would show up empty as usual, but the list of results would contain:

- Entity (Base Type)
- EntityRepository (Because of EntityRepository<User>)
- EntityService (Because of EntityService<User, ...>)

I can either select one of the items in the list, or start typing, at which point my related items go away and the search functions as before.

Comment actions Permalink

Hi Jon,

Have you actually tried using Go To Everything with ReSharper 8 EAP?
Basically it works pretty much as you described in most cases, e.g. Recent Files are there if there's nothing typed into the search text field.


Comment actions Permalink

I had some issues installing 8.0, some of it worked and I did see a bit of the Go To Everything but I had to uninstall the first build and don't remember the Recent functionality you mention. Let me check it out again.  But from your comment, "Recent" files is helpful if I've closed the editor for that file, but if the editor is still open in another tab I'd just use ctrl+tab and visual studio's rather usable tabbing interface to find what I'm looking for.

I'll give 8.0 another shot.  Personally I think related is of more use than recent, but maybe that's just my personal workflow.  Another thought, if you guys decide to stick with Recent as the default no-search-text behavior, can you provide a hook for a plugin to replace that functionality?  I'd like to add the behavior I mentioned to my plugin.



Please sign in to leave a comment.