update references to "PsiViewer" functionality

This commit is contained in:
Yann Cébron 2024-11-18 11:56:48 +01:00
parent c40b0571c5
commit b4be530258
7 changed files with 14 additions and 12 deletions

View File

@ -155,8 +155,9 @@ must not be used, see [](api_internal.md) for more details and replacements.
## 3 Tools and References
### 3.1 Use Internal Mode and PsiViewer
{id="internalMode"}
As a plugin developer, you should enable the [internal mode](enabling_internal.md) in IntelliJ IDEA.
When developing plugins, always enable the [internal mode](enabling_internal.md) in IntelliJ IDEA.
This provides access to a suite of tools to help you develop, debug, and test IntelliJ Platform plugins.
One of its most helpful features is the [UI Inspector](internal_ui_inspector.md),

View File

@ -72,7 +72,7 @@ This last example shows that corner cases need to be considered carefully even f
## Tools and Debugging
Working with element patterns can be tricky, and plugin authors need a solid understanding of the underlying PSI structure to get it right.
Therefore, it is recommended to use the [PsiViewer plugin or built-in PSI viewer](explore_api.md#31-use-internal-mode-and-psiviewer) and verify that elements indeed have the expected structure and properties.
Therefore, it is recommended to use the [PsiViewer plugin or built-in PSI viewer](explore_api.md#internalMode) and verify that elements indeed have the expected structure and properties.
### Debugging

View File

@ -1,13 +1,13 @@
# Program Structure Interface (PSI)
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Program Structure Interface (PSI)
<link-summary>Introduction to Program Structure Interface (PSI) responsible for parsing and creating the syntactic and semantic code model.</link-summary>
The Program Structure Interface, commonly referred to as just PSI, is the layer in the IntelliJ Platform responsible for parsing files and creating the syntactic and semantic code model that powers so many of the platform's features.
The Program Structure Interface, commonly referred to as PSI, is the layer in the IntelliJ Platform responsible for parsing files and creating the syntactic and semantic code model that powers so many of the platform's features.
* [PSI Files](psi_files.md)
* [File View Providers](file_view_providers.md)
* [PSI Elements](psi_elements.md)
> See [useful tools](explore_api.md#31-use-internal-mode-and-psiviewer) on how to inspect the PSI structure and its properties.
> See [useful tools](explore_api.md#internalMode) on how to inspect the PSI structure and its properties.

View File

@ -18,8 +18,8 @@ This allows the formatting engine to calculate the smallest number of whitespace
## Introduction
The easiest way to understand how formatting works in practice is to use a small code example in an existing language and
use [PsiViewer](explore_api.md#31-use-internal-mode-and-psiviewer) to inspect how formatting blocks are built.
To invoke PsiViewer with the possibility of inspecting <control>Block Structure</control>,
use the [built-in PSI viewer](explore_api.md#internalMode) to inspect how formatting blocks are built.
To invoke the builtin PSI viewer with the possibility of inspecting <control>Block Structure</control>,
use <ui-path>Tools | View PSI Structure...</ui-path> or <ui-path>Tools | View PSI Structure of Current File...</ui-path>.
![Formatting Blocks Structure](psi_viewer_formatting_blocks.png){width="706"}

View File

@ -87,7 +87,7 @@ Every element which can be renamed or referenced (a class definition, a method d
Several functions which can be used for implementing and using the PSI can be found in the `com.intellij.psi.util` package, and in particular in the [`PsiUtilCore`](%gh-ic%/platform/core-api/src/com/intellij/psi/util/PsiUtilCore.java) and [`PsiTreeUtil`](%gh-ic%/platform/core-api/src/com/intellij/psi/util/PsiTreeUtil.java) classes.
> Use [builtin tools and PsiViewer plugin](explore_api.md#31-use-internal-mode-and-psiviewer) to explore and inspect PSI.
> Use [PsiViewer plugin or built-in PSI viewer](explore_api.md#internalMode) to explore and inspect PSI.
>
Please see [Indexing and PSI Stubs](indexing_and_psi_stubs.md) for advanced topics.

View File

@ -116,6 +116,7 @@ key\ with\ spaces = This is the value that could be looked up with the key "key
tab : \u0009
```
Now open the <control>PsiViewer</control> tool window and check how the lexer breaks the content of the file into tokens, and the parser transforms the tokens into PSI elements.
Use the [PsiViewer plugin or built-in PSI viewer](explore_api.md#internalMode) and check how the lexer breaks the content of the file into tokens,
and the parser transforms the tokens into PSI elements.
![PSI Elements](psi_elements.png)

View File

@ -40,8 +40,8 @@ Note the last few lines define a purposely incorrect key.
{src="simple_language_plugin/src/test/testData/ParsingTestData.simple"}
## Copy the Expected PSI Tree
The easiest way to get the expected PSI structure for any file is to use the PSI Viewer.
Run the project and use <ui-path>Tools | View PSI Structure</ui-path>
The easiest way to get the expected PSI structure for any file is to use the [built-in PSI viewer](explore_api.md#internalMode).
Run the project and use <ui-path>Tools | View PSI Structure...</ui-path>
(enable [Internal Mode](enabling_internal.md) explicitly for the IDE instance if the menu is not available).
![PSI Tree Copy](plugin_copy_psi.png)