Internal mode

We can run ReSharper in a special mode called the Internal mode (sometimes called god mode). This mode provides you with access to some tools and commands that are very useful when you are creating plugins.

In the Internal mode, two new options are available.

The first provides new entries in the Options window. These entries are as follows:

  • Tools | SolBuilderDuo: This allows you to change the settings related to building plugins
  • Internal: This allows you to change the settings related to exceptions, logging, and the tracking activity
  • Internal UI Options: This allows to you change UI-related settings

The second one is a new option, Internal, in the ReSharper menu as presented in the following screenshot:

Internal mode

In this menu, you can find a lot of useful options. The most useful are as follows:

  • PSI Browser: This can be found by navigating to Internal | Windows
  • PSI Module Browser: This can be found by navigating to Internal | Windows
  • PSI Viewer: This is available directly in the Internal menu

PSI Browser

PSI Browser is one of the most useful options. It allows you to review the PSI tree for the currently opened file.

A sample PSI Browser window is shown in the following screenshot:

PSI Browser

As you can easily see, the PSI Browser window contains a tree structure for the C# file. There are two separate nodes for using statements and the namespace. As tree nodes expand, you can see more code details with all the information needed for creating plugins.

Reviewing PSI Browser is the best way to learn about PSI tree structure and PSI types.

PSI Module Browser

The PSI Module Browser window allows you to review all the modules (assemblies) in your project and track the references between them, as shown in the following screenshot:

PSI Module Browser

As you can see in the preceding screenshot, each module contains two nodes, References and Referenced By, which show the relations with other modules (for example, EnvDTE80 library is referenced by the JetBrains.ReSharper.SolutionBuilder.vs library).

PSI Viewer

The PSI Viewer window is very similar to PSI Browser with a single change; it allows you to write code snippets and check how code is represented as a PSI tree.

Tip

Remember that you have full access to all the information available on the PSI Viewer window via the ReSharper SDK, and you can use it in your plugin.

Enabling the Internal mode

To run ReSharper in the Internal mode, you need to run Visual Studio with the /ReSharper.Internal parameter. You can add this parameter to the Target field in the Visual Studio shortcut properties as presented in the following screenshot:

Enabling the Internal mode

Or, you can just write the following line in the command line:

devenv.exe /ReSharper.Internal
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.148.104.124