With the PSI viewer, you can explore the internal structure of your source code, as it is interpreted by WebStorm.
Enable the PSI Viewer
Select Configure on the Welcome screen and then select Edit Custom Properties.from the menu or click
WebStorm creates an empty idea.properties file in the configuration directory and opens it in a new editor tab. Learn more from Configuring platform properties.
In the idea.properties file, type
View the PSI structure of your source code
From themenu, select .
In the PSI Viewer dialog, type or paste the fragment of source code to be analyzed in the Text area, select a file type, and specify other options.
From the Show PSI structure for list, select the file type or the language construct to be explored. The set of recognized file types depends on the supported languages and installed plugins.
Select the Show PsiWhiteSpace checkbox to show the
PsiWhiteSpacenodes that correspond to the spaces in the source code.
In the Text pane, enter the source code to be explored. Type the text manually or paste it from the clipboard. If you have copied some text from the editor, and then open the PSI viewer, the previous contents of the Text pane is selected, which enables you to overwrite it from the clipboard using Control+V, or Control+Shift+V.
As you enter the code, you can remove line at caret by pressing Control+Y, duplicate text with Control+D, and add lines using Shift+Enter.
Click Build PSI Tree to generate a PSI structure tree view and preview the generated PSI tree in the PSI Structure pane.
If the source code in the Text pane is modified, click Build PSI Tree to refresh the tree view.
Navigating though the tree view highlights the corresponding fragments of source code in the Text pane. If currently selected tree node has references, they are also displayed in the References pane.
The References read-only field shows references to the nodes of the PSI Structure tree view (if any).
Unresolved references are shown red; the corresponding fragments of source code are also highlighted with a red frame.