Child pages
  • Introducing JetBrains dotPeek

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Another noticeable ReSharper-like feature gets handy when you want to select a part of decompiled code, and is called Extend/Shrink Selection. Using a dedicated shortcut (by default, Ctrl+WAlt+Right) lets you successively select expanding blocks of code, starting from a substring of a symbol, on to a statement, line, code block, and all the way to the entire code file. A pair shortcut (Ctrl+ShiftAlt+WLeft) works the opposite way, successively narrowing a selection. Read more about this functionality as it is implemented in ReSharper.

...

  • Edit > Parameter Information (Ctrl+P) on a method call will display all available signatures of a given method.
  • Edit > Show Quick Documentation (Ctrl+QShift+F1) on a usage of a type, method, property, or another type member will display an overview of its documentation comments:

...

Use Navigate > Go to Type (Ctrl+NT) to navigate to a specific class or interface. You type in the name of the type you want to find, and dotPeek searches for a match within all loaded assemblies. Here again, the concept of CamelHumps is applicable - you don't need to type DynamicMethodGenerator to open this class - typing dmg is enough:

...

Use Navigate > Go to Symbol (Ctrl+Shift+Alt+NT) to navigate to a specific symbol declaration, which could be a type, method, field, or property. Again, use CamelHumps to narrow down the list of symbols that dotPeek presents:

Since the number of symbols is greatly higher than that of types, and there can possibly be multiple symbols with the same name, you may want to spend a little more time investigating the list of results. One way to do that is press the plus sign (Show in Find Results) while dotPeek shows symbols in the Go to Symbol drop-down list - this will allow you to flush all found results to the Find Results tool window where you can take your time to investigate the results, group based on different criteria, copy to clipboard or export to a file.

...

As soon as you've opened a specific type, use Navigate > Go to File Member (_Alt+_) for a quick overview of and navigation to members in this file.

Alternatively, you can open the File Structure tool window (Windows > File Structure, or Ctrl+F11Alt+F) for a static display of members in the current file.

File Structure provides additional file browsing capabilities: for example, if you set Automatically scroll to source in File Structure toolbar, every time you select a member in File Structure, the code view area scrolls to the declaration of this member.
The Track caret in editor option works the opposite way: as you move the caret within the code view area, the corresponding member is highlighted in File Structure.
You can learn more about File Structure options in ReSharper web help.

...

dotPeek also provides Go to File (Navigate > Go to File or Ctrl+Shift+NT) to quickly open files and folders, and assemblies. There are two use cases for this feature:

...

Speaking of previously opened files, if you've recently closed a code file but you need to have it open again, there's an easy way to have it back: just choose Navigate > Recent Files (Ctrl+E,) and in the resulting drop-down list, pick the file you're looking for:

...

dotPeek provides the same level of insight in context-sensitive navigation between decompiled code symbols as ReSharper does for source code. You navigate to symbol declarations, implementations, derived and base symbols, and any other applicable destinations just like you would in Visual Studio with ReSharper enabled.
Specifically, when you've landed the caret on a symbol, you can always get an overview of all possible navigation targets using the Navigate To drop-down menu (Navigate > Navigate To or CtrlAlt+Shift+G`):

The majority of navigation destinations presented in the Navigate To drop-down menu are also available directly through the top-level Navigate menu.
The following context-sensitive navigation commands can be available depending on context:

  • Go to Declaration (Ctrl+BF12): this takes you from a usage of any symbol to its declaration. Should the symbol be dependent on another assembly, the assembly will be loaded silently, if available.
  • Go to Base Symbols (CtrlAlt+UHome): this takes you to corresponding symbols upwards the inheritance hierarchy:
  • Go to Derived Symbols (Ctrl+Alt+BEnd): the opposite of base symbols, this command lets you go to any of implementing/overriding members or implementing/derived types:
  • Go to Implementation (Ctrl+Shift+Alt+BF12): allowing navigating to end implementations of types and type members, bypassing intermediate inheritance steps in the inheritance chain, such as abstract classes.
  • Go to Extension Methods (only available through Navigate To): shows all extension methods for a certain type.
  • Go to Sources from Symbol Files (only available through Navigate To): download symbol information from a source server and recreate source code. (See below for more information.)
  • Go to Assembly Explorer (only available through Navigate To): navigates from a type or type member in source code view to the corresponding node in the Assembly Explorer. Interestingly, this command is duplicated by another shortcut, Shift+Alt+L, that, when applied in ReSharper, locates the currently open file in the Solution Explorer.

...

dotPeek offers the same capabilities of searching for items in decompiled code as ReSharper offers in source code inside Visual Studio. Here's the list of features serving to find all references to a certain symbol:

  • Navigate > Find Usages (AltShift+F7F12): This finds all usages of a symbol (method, property, local variable etc.) from its any occurrence, be it a declaration or one of its usages. You can invoke this command from the code view area, from the Assembly Explorer, or any other tool window. If more than a single usage is found, all usages are fetched to the Find Results tool window where you can group them in different ways, navigate between them, and open in the code view area. You can learn more about Find Usages on ReSharper web site.
  • Navigate > Usages of Symbol (CtrlShift+Alt+F7F12): This is a modification on Find Usages that shows a pop-up with all found usages instead of flushing them to Find Results. This is handy when you have a limited set of usages from which you can quickly pick the one you need. It is also available via the Navigate To drop-down menu.
  • Navigate > Find Usages Advanced (Ctrl+Shift+Alt+F7F12): This is a zoomed-in version of Find Usages that allows you to fine-tune search criteria by limiting the scope of search and other characteristics.

...

When it comes to customizing your workspace within dotPeek, you do need the mouse but otherwise, it's plain easy and familiar. Tool windows behave the same way they do in Visual Studio: they can be left floating or docked in multiple positions. Find Results and Type Hierarchy support multiple tabs, allowing you to have several sets of search results or hierarchies open at the same time, and File Structure content can be filtered to only display results that match a search string:

What's Next