In CodeRush Classic 15.1 and in CodeRush for Roslyn we added the ability to filter Intellisense members by the class where they are declared.
Here’s how it works. To show this in action, I created a new Windows Universal App, and opened the MainPage.xaml.cs file. Inside the constructor, I typed “this.”
Here’s what I see:
That’s about 165 entries. That’s a lot to wade through. I can reduce the list if I have an idea of where to look in the hierarchy.
With IntelliRush’s new Hierarchical Filtering, this is easy. I tap the Ctrl key…
On the right I see “Hierarchy”.
So I press the letter “h” and I see the class hierarchy listed on the right, from MainPage (the type of the “this” reference) up to Object…
Now, if I know the class I want to see members from, I can simply press the number associated with that class. For example, if I only want to see members from the FrameworkElement class shown in this list, I simply press the number 4 from the hint, and my list of 165 members drops to 34:
If I want to slice the class hierarchy to include a range of classes, for example UIElement and up, I can do the following:
- Tap Ctrl
- Press h
The Hierarchy hint displays:
UIElement is number 5. So if I want to see members declared in UIElement and all its ancestors, all I need to do is… - Press Shift+5
And with those three keystrokes IntelliRush shows only the entries declared in UIElement and up:
Shift + the class number shows members declared in the specified class and above.
Ctrl + the class number shows members declared in the specified class and below.
On most keyboards the Shift key is above the Ctrl key, so you may find their position (Shift above, Ctrl below) helpful in remembering which modifier key to hit.
The active class is always numbered zero, which allows for some useful shortcuts to keep in mind:
Member Scope | To filter, tap Ctrl, press H, and then: |
Active class only | 0 |
Parent class only | 1 |
Active & parent classes only | Ctrl+1 |
Parent class and above | Shift+1 |
All classes (resets an active filter) | Shift+0 |
Combining Filters
You can combine a hierarchical filter with a member kind filter. Only want to see events declared in the active class or its ancestor? Easy. First, apply a hierarchical filter to isolate members to only the ancestry you’re interested in. Next, apply the member kind filter you want (e.g., tap Ctrl, then press E, to only see events).
Try it Out
IntelliRush’s Hierarchical Filtering is available in both CodeRush Classic 15.1 and CodeRush for Roslyn 1.0.