Child pages
  • Introducing JetBrains dotPeek

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Wiki Markup
{redirect:NETCOM:Introducing JetBrains dotPeek}

Table of Contents

What is dotPeek

...

Both distributions are functionally equivalent except for the way you configure Windows Explorer integration.

General Features

For all features described below, default keyboard shortcuts are specified. By default, dotPeek uses the Visual Studio shortcut scheme derived from ReSharper. dotPeek also provides another shortcut scheme familiar to ReSharper users - that is, the IntelliJ IDEA scheme. You can switch between those schemes via File under Tools > Options > Environment > General.

All shortcuts defined in both Visual Studio and IntelliJ IDEA shortcut schemes are listed in a document called dotPeek Keyboard Shortcuts that is available from dotPeek via Help > Keyboard Shortcuts.

...

  • Using the File > Open command.
  • Via drag-and-drop of a file (or a selection of files) to dotPeek window.
  • For .dll files: By double-clicking a file in Windows Explorer (provided that Windows Explorer integration is configured.)
  • For .dll and .exe files: By right-clicking a file in Windows Explorer and selecting Browse with JetBrains dotPeek.

In addition, assemblies You can also load entire folders in the Assembly Explorer by choosing File > Explore Folder. When you ask dotPeek to explore a folder, it processes all its subfolders in hunt for files that it is able to decompile, and displays the folder's hierarchy in the Assembly Explorer.

Image Added

Note

Since dotPeek processes a selected folder recursively, make sure to act wise selecting one. You wouldn't really want to explore the entire Program Files folder since it would take a really long time to load all assemblies that it contains in dotPeek.

Assemblies from Global Assembly Cache can be opened via File > Open from GAC. One thing to note about the Open from GAC dialog is that you can batch-select assembly items there, and you can also filter out assemblies by entering their CamelHumps - the capitals that different parts of assembly names start with. For example, to find all assemblies with names containing Microsoft.VisualStudio.Modeling in the list of GAC assemblies, you can type mvsm:

CamelHumps support is a significant an important concept that also spans multiple navigation features of dotPeek that are highlighted below.

dotPeek provides the Assembly Explorer to traverse the list of opened assemblies. Expanding an assembly node lists namespaces within the assembly that can be further expanded to types and type members, as well as assembly references.

In addition, the Assembly Explorer contains nodes representing base types and inheritors of the current type. This is a way to browse type inheritance trees that developers with Reflector background usually find appealing. However, dotPeek also provides a bunch of ReSharper-inspired navigation features that work not only from the Assembly Explorer but from other tool windows and from the source code view areas as well.

...

To apply order to the way you work with multiple assemblies, and also to support switching between different sets of assemblies, dotPeek provides assembly lists. You can now work with different assembly lists depending on your context. You can save and reopen assembly lists, and or clear the current list if you no longer need it.

...

Assembly lists are not limited to .dll and .exe files: they can contain all supported file types (including archives) and folders.

Anchor
windows_explorer
windows_explorer

...

This is accomplished in two different ways depending on the type of dotPeek distribution that you're using.

If you're installing deploying dotPeek using the installer, Windows Explorer integration is set using the installation wizard.

...

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

Using the Show compiler-generated code switch on the dotPeek toolbar, you can choose to turn off certain compiler transformations, thus making code structure that dotPeek displays very similar to what the compiler turns it to. This helps see how compiler deals with lambdas, closures, and auto-properties, among other things.

Image Added

Navigation and Search

The primary idea behind dotPeek is to bring ReSharper experience to browsing external assemblies and make this available to everyone. The main thing that distinguishes dotPeek from other decompilers around is that the majority of ReSharper navigation features are available in dotPeek as well. Let's take a closer look at those:

Anchor
context-insensitive_navigation
context-insensitive_navigation

Context-Insensitive Navigation in Decompiled Code

...

Use Navigate > Go to Type (Ctrl+T) 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 DatasetMethodGenerator to open this class - typing dmg is enough:

...

Decompiled code is better than nothing (especially if it's decompiled with dotPeek) but sometimes you want to explore an assembly exactly the way it had been originally written, and be able to read comments its developers have made. Sometimes dotPeek can help with that: it is able to get symbol information and recreate source code from Microsoft Reference Source Center and SymbolSource.org. You can try calling Navigate > Navigate To > Sources from Symbol Files on a type or member and see if symbol information for this particular assembly is available. You can even go as far as make downloading symbol files the default action for Go to declaration - to do that go to File Tools > Options > Decompiler and select Allow downloading from remote locations.

Image Added

Use the navigation mode drop-down in the menu bar to choose whether you only want dotPeek to decompile assemblies, or try find source code if possible.

Keyboard-Driven Navigation Between Tool Windows

...