From b4be530258aae12e907b84a2ed81f523db07b84c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Mon, 18 Nov 2024 11:56:48 +0100 Subject: [PATCH] update references to "PsiViewer" functionality --- topics/appendix/resources/explore_api.md | 3 ++- topics/basics/architectural_overview/element_patterns.md | 2 +- topics/basics/architectural_overview/psi.md | 8 ++++---- .../custom_language_support/code_formatting.md | 4 ++-- .../implementing_parser_and_psi.md | 2 +- .../lexer_and_parser_definition.md | 3 ++- .../tutorials/writing_tests_for_plugins/parsing_test.md | 4 ++-- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/topics/appendix/resources/explore_api.md b/topics/appendix/resources/explore_api.md index 7effddade..d30c074e3 100644 --- a/topics/appendix/resources/explore_api.md +++ b/topics/appendix/resources/explore_api.md @@ -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), diff --git a/topics/basics/architectural_overview/element_patterns.md b/topics/basics/architectural_overview/element_patterns.md index e25971d65..506a48978 100644 --- a/topics/basics/architectural_overview/element_patterns.md +++ b/topics/basics/architectural_overview/element_patterns.md @@ -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 diff --git a/topics/basics/architectural_overview/psi.md b/topics/basics/architectural_overview/psi.md index 5597a4692..d98dd3896 100644 --- a/topics/basics/architectural_overview/psi.md +++ b/topics/basics/architectural_overview/psi.md @@ -1,13 +1,13 @@ -# Program Structure Interface (PSI) + - +# Program Structure Interface (PSI) Introduction to Program Structure Interface (PSI) responsible for parsing and creating the syntactic and semantic code model. -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. diff --git a/topics/reference_guide/custom_language_support/code_formatting.md b/topics/reference_guide/custom_language_support/code_formatting.md index 11bac0670..7b4d34ca3 100644 --- a/topics/reference_guide/custom_language_support/code_formatting.md +++ b/topics/reference_guide/custom_language_support/code_formatting.md @@ -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 Block Structure, +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 Block Structure, use Tools | View PSI Structure... or Tools | View PSI Structure of Current File.... ![Formatting Blocks Structure](psi_viewer_formatting_blocks.png){width="706"} diff --git a/topics/reference_guide/custom_language_support/implementing_parser_and_psi.md b/topics/reference_guide/custom_language_support/implementing_parser_and_psi.md index 36a8ff038..8affbb0a0 100644 --- a/topics/reference_guide/custom_language_support/implementing_parser_and_psi.md +++ b/topics/reference_guide/custom_language_support/implementing_parser_and_psi.md @@ -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. diff --git a/topics/tutorials/custom_language_support/lexer_and_parser_definition.md b/topics/tutorials/custom_language_support/lexer_and_parser_definition.md index 85ac36b8d..3488715d3 100644 --- a/topics/tutorials/custom_language_support/lexer_and_parser_definition.md +++ b/topics/tutorials/custom_language_support/lexer_and_parser_definition.md @@ -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 PsiViewer 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) diff --git a/topics/tutorials/writing_tests_for_plugins/parsing_test.md b/topics/tutorials/writing_tests_for_plugins/parsing_test.md index c9875782f..e314b1fd5 100644 --- a/topics/tutorials/writing_tests_for_plugins/parsing_test.md +++ b/topics/tutorials/writing_tests_for_plugins/parsing_test.md @@ -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 Tools | View PSI Structure +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 Tools | View PSI Structure... (enable [Internal Mode](enabling_internal.md) explicitly for the IDE instance if the menu is not available). ![PSI Tree Copy](plugin_copy_psi.png)