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:
The second one is a new option, Internal, in the ReSharper menu as presented in the following screenshot:
In this menu, you can find a lot of useful options. The most useful are as follows:
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:
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.
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:
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).
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.
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:
Or, you can just write the following line in the command line:
devenv.exe /ReSharper.Internal
3.148.104.124