diff --git a/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_migration.md b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_migration.md index 6155fa52d..b5c4fccf8 100644 --- a/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_migration.md +++ b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_migration.md @@ -90,7 +90,7 @@ The `intellij.plugins` property is no longer available. Define dependencies on plugins or bundled plugins in `dependencies {}` block instead: -**Example**: +**Example:** Setting up dependencies on comma-separated plugins listed in `platformPlugins` and `platformBundledPlugins` properties from gradle.properties. diff --git a/topics/basics/execution/execution.md b/topics/basics/execution/execution.md index b95655f96..fcb4fd9ae 100644 --- a/topics/basics/execution/execution.md +++ b/topics/basics/execution/execution.md @@ -1,4 +1,4 @@ - + # Execution @@ -121,7 +121,7 @@ A standard implementation of `ProgramRunner.execute()` goes through the followin It starts the process, attaches a `ProcessHandler` to its input and output streams, creates a console to display the process output, and returns an `ExecutionResult` object aggregating the `ExecutionConsole` and the `ProcessHandler`. 3. The `RunContentBuilder` object is created and invoked to display the execution console in a Run or Debug tool window tab. -**Example**: +**Example:** [`RunAnythingCommandProvider.runCommand()`](%gh-ic%/platform/lang-impl/src/com/intellij/ide/actions/runAnything/activity/RunAnythingCommandProvider.java), which programmatically executes a command typed by a user in the Run Anything popup ## Standard Base Classes diff --git a/topics/basics/execution/run_configurations.md b/topics/basics/execution/run_configurations.md index 82ddeb521..4be9c67bd 100644 --- a/topics/basics/execution/run_configurations.md +++ b/topics/basics/execution/run_configurations.md @@ -111,7 +111,7 @@ If the settings editor requires validation, implement [`CheckableRunConfiguratio If the settings editor is complex, see [](#simplifying-settings-editors) for solutions. -**Example**: [DemoSettingsEditor](%gh-sdk-samples-master%/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java) from the `run_configuration` code sample. +**Example:** [DemoSettingsEditor](%gh-sdk-samples-master%/run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java) from the `run_configuration` code sample. ## Persistence @@ -195,7 +195,7 @@ It makes the editor smaller, freeing it from the clutter of unused settings fiel To implement a fragmented settings editor in a run configuration, extend [`RunConfigurationFragmentedEditor`](%gh-ic%/platform/execution-impl/src/com/intellij/execution/ui/RunConfigurationFragmentedEditor.java) and implement `createRunFragments()`. The method must return a list of [`SettingsEditorFragment`](%gh-ic%/platform/platform-api/src/com/intellij/execution/ui/SettingsEditorFragment.java) instances, which represent particular settings fragments that users can enable and configure. -**Examples**: +**Examples:** - [`JavaApplicationSettingsEditor`](%gh-ic%/java/execution/impl/src/com/intellij/execution/application/JavaApplicationSettingsEditor.java) - [`MavenRunConfigurationSettingsEditor`](%gh-ic%/plugins/maven/src/main/java/org/jetbrains/idea/maven/execution/run/configuration/MavenRunConfigurationSettingsEditor.kt) @@ -210,7 +210,7 @@ A complex settings editor can be split into smaller editors focused on a specifi These editors should be added to the [`SettingsEditorGroup`](%gh-ic%/platform/ide-core/src/com/intellij/openapi/options/SettingsEditorGroup.java) object, which is a `SettingsEditor`'s implementation itself and must be returned from `getConfigurationEditor()` or `getRunnerSettingsEditor()`. Each editor added to the group is displayed in a separate tab. -**Example**: [`ApplicationConfiguration.getConfigurationEditor()`](%gh-ic%/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java) +**Example:** [`ApplicationConfiguration.getConfigurationEditor()`](%gh-ic%/java/execution/impl/src/com/intellij/execution/application/ApplicationConfiguration.java) ## Refactoring Support diff --git a/topics/basics/indexing_and_psi_stubs/stub_indexes.md b/topics/basics/indexing_and_psi_stubs/stub_indexes.md index fd26681b6..0dc4cf55b 100644 --- a/topics/basics/indexing_and_psi_stubs/stub_indexes.md +++ b/topics/basics/indexing_and_psi_stubs/stub_indexes.md @@ -38,7 +38,7 @@ The following steps need to be performed only once for each language that suppor Define the common `externalIdPrefix` to be used for all stub element types (see [](#adding-stub-elements)). See [`StubElementTypeHolderEP`](%gh-ic%/platform/core-api/src/com/intellij/psi/stubs/StubElementTypeHolderEP.java) docs for important requirements. -**Examples**: +**Examples:** - [`JavaStubElementTypes`](%gh-ic%/java/java-psi-impl/src/com/intellij/psi/impl/java/stubs/JavaStubElementTypes.java) registered in [`JavaPsiPlugin.xml`](%gh-ic%/java/java-psi-impl/src/META-INF/JavaPsiPlugin.xml) - see [`Angular2MetadataElementTypes`](%gh-ij-plugins%/Angular/src/org/angular2/entities/metadata/Angular2MetadataElementTypes.kt) for Kotlin sample @@ -114,7 +114,7 @@ To access the data from an index, the following instance methods are used on the [`StubIndex.getElements()`](%gh-ic%/platform/indexing-api/src/com/intellij/psi/stubs/StubIndex.java) returns the collection of PSI elements corresponding to a certain key (for example, classes with the specified short name) in the specified scope. -**Example**: [`JavaAnnotationIndex`](%gh-ic%/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnnotationIndex.java) +**Example:** [`JavaAnnotationIndex`](%gh-ic%/java/java-indexing-impl/src/com/intellij/psi/impl/java/stubs/index/JavaAnnotationIndex.java) ## Related Forum Discussions diff --git a/topics/basics/testing_plugins/light_and_heavy_tests.md b/topics/basics/testing_plugins/light_and_heavy_tests.md index 831ef3bb0..b2acbf1c9 100644 --- a/topics/basics/testing_plugins/light_and_heavy_tests.md +++ b/topics/basics/testing_plugins/light_and_heavy_tests.md @@ -31,7 +31,7 @@ for tests that don't have any dependency on Java functionality. For 2019.2 and earlier, use [`LightPlatformCodeInsightFixtureTestCase`](%gh-ic%/platform/testFramework/src/com/intellij/testFramework/fixtures/LightPlatformCodeInsightFixtureTestCase.java). -**Examples**: +**Examples:** - [`JavaCopyrightTest`](%gh-ic%/java/java-tests/testSrc/com/intellij/copyright/JavaCopyrightTest.kt) - [`HtmlDocumentationTest`](%gh-ic%/xml/tests/src/com/intellij/html/HtmlDocumentationTest.java) - [`AcceptWordAsCorrectTest`](%gh-ic%/spellchecker/testSrc/com/intellij/spellchecker/inspector/AcceptWordAsCorrectTest.java) @@ -47,7 +47,7 @@ For tests that require the [Java PSI](idea.md#java) or related functionality: For 2019.2 and earlier, use [`LightCodeInsightFixtureTestCase`](%gh-ic%/java/testFramework/src/com/intellij/testFramework/fixtures/LightCodeInsightFixtureTestCase.java). -**Examples**: +**Examples:** - [`PatternValidatorTest`](%gh-ic%/plugins/IntelliLang/IntelliLang-tests/test/org/intellij/plugins/intelliLang/pattern/PatternValidatorTest.java) (JUnit 3) - [`JavaCtrlMouseTest`](%gh-ic%/java/java-tests/testSrc/com/intellij/java/codeInsight/javadoc/JavaCtrlMouseTest.kt) (JUnit 4) - [`MissingJavadocHighlightingTest`](%gh-ic%/java/java-tests/testSrc/com/intellij/java/codeInsight/daemon/MissingJavadocHighlightingTest.java) (JUnit 5) @@ -72,7 +72,7 @@ The standard way of writing a heavy test is to extend [`HeavyPlatformTestCase`]( > {style="note"} -**Examples**: +**Examples:** - [`ModuleDeleteProviderTest`](%gh-ic%/java/java-tests/testSrc/com/intellij/openapi/roots/ui/configuration/actions/ModuleDeleteProviderTest.java) - [`FacetTypeUnloadingTest`](%gh-ic%/java/idea-ui/testSrc/com/intellij/facet/FacetTypeUnloadingTest.kt) - [`SourceFolderManagerTest`](%gh-ic%/platform/external-system-impl/testSrc/com/intellij/openapi/externalSystem/service/project/manage/SourceFolderManagerTest.kt) diff --git a/topics/basics/testing_plugins/testing_highlighting.md b/topics/basics/testing_plugins/testing_highlighting.md index ac0e8ef60..65dd0dec2 100644 --- a/topics/basics/testing_plugins/testing_highlighting.md +++ b/topics/basics/testing_plugins/testing_highlighting.md @@ -13,7 +13,7 @@ To ignore verifying additional highlighting, set parameter `ignoreExtraHighlight Alternatively, you can use `CodeInsightTestFixture.testHighlighting()`, which loads a [testdata file](test_project_and_testdata_directories.md) into the in-memory editor and highlights it as a single operation. -**Example**: +**Example:** [Custom Language Support Tutorial: Testing Annotator](annotator_test.md) ### Inspections diff --git a/topics/reference_guide/custom_language_support/code_completion.md b/topics/reference_guide/custom_language_support/code_completion.md index d32cd3ebb..17887585d 100644 --- a/topics/reference_guide/custom_language_support/code_completion.md +++ b/topics/reference_guide/custom_language_support/code_completion.md @@ -50,7 +50,7 @@ If you want to match a composite element, use `withParent()` or `withSuperParent If completion items do not depend on indexes (e.g., keywords), it can be marked as [dumb aware](indexing_and_psi_stubs.md#DumbAwareAPI). -**Examples**: +**Examples:** - [`CompletionContributor`](%gh-ij-plugins%/osmorc/src/org/osmorc/manifest/completion/OsgiManifestCompletionContributor.java) for completing keywords in MANIFEST.MF files. - [Custom Language Support Tutorial: Completion Contributor](completion_contributor.md) diff --git a/topics/reference_guide/custom_language_support/code_formatting.md b/topics/reference_guide/custom_language_support/code_formatting.md index c27da14e0..bd6087b31 100644 --- a/topics/reference_guide/custom_language_support/code_formatting.md +++ b/topics/reference_guide/custom_language_support/code_formatting.md @@ -1,4 +1,4 @@ - + # Code Formatter @@ -77,7 +77,7 @@ If the block before the cursor is incomplete (contains elements that the user wi Code formatting can be suppressed per region via [special comments](https://youtrack.jetbrains.com/issue/IDEA-56995#comment=27-605969). -**Example**: +**Example:** [Custom Language Support Tutorial: Formatter](formatter.md) ## Non-Whitespace Modifications @@ -117,7 +117,7 @@ Please see [`Rearranger`](%gh-ic%/platform/code-style-api/src/com/intellij/psi/c To specify the default indent size for the language provided by your plugin, and to allow the user to configure the tab size and indent size, you need to implement the [`FileTypeIndentOptionsProvider`](%gh-ic%/platform/lang-api/src/com/intellij/psi/codeStyle/FileTypeIndentOptionsProvider.java) interface and to register the implementation in the `com.intellij.fileTypeIndentOptionsProvider` extension point. The return value of `createIndentOptions()` determines the default indent size. -**Example**: +**Example:** [Custom Language Support Tutorial: Code Style Settings](code_style_settings.md) ## Restricting Formatting @@ -130,5 +130,5 @@ _2021.3_ Register [`AsyncDocumentFormattingService`](%gh-ic%/platform/code-style-api/src/com/intellij/formatting/service/AsyncDocumentFormattingService.java) implementation in the [`com.intellij.formattingService`](https://jb.gg/ipe?extensions=com.intellij.formattingService) extension point to invoke external formatter instead of IDE's builtin formatter. -**Example**: +**Example:** [`ShExternalFormatter`](%gh-ic%/plugins/sh/core/src/com/intellij/sh/formatter/ShExternalFormatter.java) from _Shell Script_ plugin diff --git a/topics/reference_guide/custom_language_support/code_inspections_and_intentions.md b/topics/reference_guide/custom_language_support/code_inspections_and_intentions.md index 830116246..e67284294 100644 --- a/topics/reference_guide/custom_language_support/code_inspections_and_intentions.md +++ b/topics/reference_guide/custom_language_support/code_inspections_and_intentions.md @@ -27,7 +27,7 @@ If none of that is required and the analysis only needs to run in the active edi See [Inspections](https://jetbrains.design/intellij/text/inspections/) topic in the IntelliJ Platform UI Guidelines on naming, writing description, and message texts for inspections. -**Examples**: +**Examples:** - [Code Inspections Tutorial](code_inspections.md) - A [simple inspection](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/codeInspection/TrailingSpacesInPropertyInspection.java) for [Properties language plugin](%gh-ic%/plugins/properties) diff --git a/topics/reference_guide/custom_language_support/find_usages.md b/topics/reference_guide/custom_language_support/find_usages.md index ed807ad0b..18db7133c 100644 --- a/topics/reference_guide/custom_language_support/find_usages.md +++ b/topics/reference_guide/custom_language_support/find_usages.md @@ -1,6 +1,6 @@ -# Find Usages + - +# Find Usages Introduction to implementing Find Usages action in custom languages. @@ -37,7 +37,7 @@ The steps of the _Find Usages_ action are the following: The text shown for each found element is taken from the [`FindUsagesProvider.getNodeText()`](%gh-ic%/platform/indexing-api/src/com/intellij/lang/findUsages/FindUsagesProvider.java) method. To group results by type, implement [`UsageTypeProvider`](%gh-ic%/platform/usageView-impl/src/com/intellij/usages/impl/rules/UsageTypeProvider.java) and register in `com.intellij.usageTypeProvider` extension point to provide custom or predefined [`UsageType`](%gh-ic%/platform/usageView/src/com/intellij/usages/impl/rules/UsageType.java). -**Examples**: +**Examples:** - Implementation of [`FindUsagesProvider`](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/findUsages/PropertiesFindUsagesProvider.java) in [Properties language plugin](%gh-ic%/plugins/properties) - [Custom Language Support Tutorial: Find Usages](find_usages_provider.md) diff --git a/topics/reference_guide/custom_language_support/implementing_lexer.md b/topics/reference_guide/custom_language_support/implementing_lexer.md index 8c36806aa..3db0278b2 100644 --- a/topics/reference_guide/custom_language_support/implementing_lexer.md +++ b/topics/reference_guide/custom_language_support/implementing_lexer.md @@ -1,4 +1,4 @@ - + # Implementing Lexer @@ -53,7 +53,7 @@ It provides syntax highlighting and other useful features for editing JFlex file > {style="note"} -**Examples**: +**Examples:** - [JFlex](%gh-ic%/plugins/properties/src/com/intellij/lang/properties/parsing/Properties.flex) definition file for [Properties language plugin](%gh-ic%/plugins/properties) - [Custom Language Support Tutorial: Lexer](lexer_and_parser_definition.md) 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 4234873ad..36a8ff038 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 @@ -1,4 +1,4 @@ - + # Implementing Parser and PSI @@ -19,7 +19,7 @@ Second, a [](psi.md) tree is built on top of the AST, adding semantics and metho Nodes of the PSI tree are represented by classes implementing the [`PsiElement`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiElement.java) interface and are created by the language plugin in the [`ParserDefinition.createElement()`](%gh-ic%/platform/core-api/src/com/intellij/lang/ParserDefinition.java) method. The top-level node of the PSI tree for a file needs to implement the [`PsiFile`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiFile.java) interface and is created in the [`ParserDefinition.createFile()`](%gh-ic%/platform/core-api/src/com/intellij/lang/ParserDefinition.java) method. -**Example**: +**Example:** [`ParserDefinition`](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/parsing/PropertiesParserDefinition.java) for [Properties language plugin](%gh-ic%/plugins/properties) > To avoid unnecessary classloading when initializing the `ParserDefinition` extension point implementation, all `TokenSet` return values should use constants from a dedicated `$Language$TokenSets` class. @@ -59,7 +59,7 @@ For example, a binary expression `a+b+c` needs to be parsed as `( (a+b) + c )`. Thus, two start markers are needed at the position of the token 'a', but that is not known until the token 'c' is read. When the parser reaches the '+' token following 'b', it can call `precede()` to duplicate the start marker at 'a' position, and then put its matching end marker after 'c'. -**Examples**: +**Examples:** - [Custom Language Support Tutorial: Grammar and Parser](grammar_and_parser.md) (using Grammar-Kit) - Simple [`PropertiesParser`](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/parsing/PropertiesParser.java) implementation for [Properties language plugin](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties). diff --git a/topics/reference_guide/custom_language_support/inlay_hints.md b/topics/reference_guide/custom_language_support/inlay_hints.md index c02a38860..f4946b20a 100644 --- a/topics/reference_guide/custom_language_support/inlay_hints.md +++ b/topics/reference_guide/custom_language_support/inlay_hints.md @@ -1,7 +1,7 @@ -# Inlay Hints - +# Inlay Hints + Providing additional code information directly in the editor without changing the document content. @@ -44,7 +44,7 @@ To provide inlay parameter hints, implement and register it in `com.intellij.codeInsight.parameterNameHints` extension point (EP). The API documentation of `InlayParameterHintsProvider` explains in detail the rationale behind all methods. -**Examples**: +**Examples:** - [`GroovyInlayParameterHintsProvider`](%gh-ic%/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInsight/hint/GroovyInlayParameterHintsProvider.kt) - shows parameter hints in Groovy code - [`KotlinInlayParameterHintsProvider`](%gh-ic%/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/codeInsight/hints/KotlinInlayParameterHintsProvider.kt) - shows parameter hints in Kotlin code @@ -66,7 +66,7 @@ To provide declarative inlay hints implement declarative and register it in `com.intellij.codeInsight.declarativeInlayProvider` EP. See the API documentation for the details. -**Examples**: +**Examples:** - [`JavaImplicitTypeDeclarativeInlayHintsProvider`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/hints/JavaImplicitTypeDeclarativeInlayHintsProvider.kt) - shows inferred type for variables declared with the `var` keyword in Java code when the inferred type may not be clear - [`JavaMethodChainsDeclarativeInlayProvider`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/hints/JavaMethodChainsDeclarativeInlayProvider.kt) - shows method return types in call chains in Java code @@ -91,7 +91,7 @@ There are two extension points for implementing a code vision provider: `CodeVisionProvider` API should be used for cases when presented information doesn't depend on the PSI. -**Examples**: +**Examples:** - [`JavaInheritorsCodeVisionProvider`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaInheritorsCodeVisionProvider.kt) - shows number of Java class or method inheritors. Clicking the inlay hint opens the list of inheritors. This provider is `DaemonBoundCodeVisionProvider`. - [`JavaReferencesCodeVisionProvider`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/daemon/impl/JavaReferencesCodeVisionProvider.kt) - shows number of usages of Java class or member. Clicking the inlay opens the list of usages or navigates to the usage if only one exists. This provider is `DaemonBoundCodeVisionProvider`. - [`VcsCodeVisionProvider`](%gh-ic%/platform/vcs-impl/src/com/intellij/codeInsight/hints/VcsCodeVisionProvider.kt) - shows the author of a given element, e.g., class or method, based on VCS information. This provider is `CodeVisionProvider`. @@ -112,7 +112,7 @@ To provide inlay hints, implement and register it in `com.intellij.codeInsight.inlayProvider` EP. See the API documentation for the details. -**Examples**: +**Examples:** - [`GroovyLocalVariableTypeHintsInlayProvider`](%gh-ic%/plugins/groovy/src/org/jetbrains/plugins/groovy/codeInsight/hint/types/GroovyLocalVariableTypeHintsInlayProvider.kt) - shows local variable types in Groovy code - [`MarkdownTableInlayProvider`](%gh-ic%/plugins/markdown/core/src/org/intellij/plugins/markdown/editor/tables/ui/MarkdownTableInlayProvider.kt) - _decorates_ tables in Markdown files. - For a more complex example, see diff --git a/topics/reference_guide/custom_language_support/navbar.md b/topics/reference_guide/custom_language_support/navbar.md index f374005c5..eccc204e8 100644 --- a/topics/reference_guide/custom_language_support/navbar.md +++ b/topics/reference_guide/custom_language_support/navbar.md @@ -1,4 +1,4 @@ - + # Navigation Bar @@ -52,4 +52,4 @@ You probably won't need to override other methods unless you want to write your Note that the `getSuitableClasses()` method on the structure view model class that implements `com.intellij.ide.structureView.TextEditorBasedStructureViewModel` (see [](structure_view.md)) must return all the element types you want to display in the navigation bar. -**Example**: [Custom Language Support Tutorial: Structure Aware Navigation Bar](structure_aware_navbar.md) +**Example:** [Custom Language Support Tutorial: Structure Aware Navigation Bar](structure_aware_navbar.md) diff --git a/topics/reference_guide/custom_language_support/references_and_resolve.md b/topics/reference_guide/custom_language_support/references_and_resolve.md index 6cfbb9779..494e5a475 100644 --- a/topics/reference_guide/custom_language_support/references_and_resolve.md +++ b/topics/reference_guide/custom_language_support/references_and_resolve.md @@ -33,7 +33,7 @@ A counterpart to the `resolve()` method is `isReferenceTo()`, which checks if th The latter method can be implemented by calling `resolve()` and comparing the result with the passed PSI element. Still, additional optimizations are possible (for example, performing the tree walk only if the element text is equal to the text of the reference). -**Examples**: +**Examples:** - [Reference](%gh-ic%/plugins/properties/src/com/intellij/lang/properties/ResourceBundleReference.java) to a ResourceBundle in the [Properties language plugin](%gh-ic%/plugins/properties) - [Custom Language Support Tutorial: Reference Contributor](reference_contributor.md) diff --git a/topics/reference_guide/custom_language_support/rename_refactoring.md b/topics/reference_guide/custom_language_support/rename_refactoring.md index 88dfe5a96..fd96e443c 100644 --- a/topics/reference_guide/custom_language_support/rename_refactoring.md +++ b/topics/reference_guide/custom_language_support/rename_refactoring.md @@ -1,6 +1,6 @@ -# Rename Refactoring + - +# Rename Refactoring Rename refactoring workflow, validation and customization. @@ -31,7 +31,7 @@ To disable renaming for specific elements, implement `com.intellij.openapi.util. If an implementation of this interface is not provided by the plugin, Java rules for validating identifiers are used. Implementations of `NamesValidator` are registered in the `com.intellij.lang.namesValidator` extension point. -**Example**: +**Example:** [`PropertiesNamesValidator`](%gh-ic%/plugins/properties/src/com/intellij/lang/properties/PropertiesNamesValidator.java) for [Properties language plugin](%gh-ic%/plugins/properties) Another way to check is @@ -40,7 +40,7 @@ unlike `NamesValidator` it allows you to more flexibly check the entered name fo To determine which elements this validator will apply to, override the `getPattern()` method returning the pattern of the element to validate. -**Example**: +**Example:** [`YAMLAnchorRenameInputValidator`](%gh-ic%/plugins/yaml/src/org/jetbrains/yaml/resolve/YAMLAnchorRenameInputValidator.java) validating YAML language anchor names `RenameInputValidator` can be extended to @@ -50,7 +50,7 @@ The `getErrorMessage()` method should return a custom error message in case of a Note that `getErrorMessage()` only works if all `RenameInputValidator` accept the new name in `isInputValid()` and the name is a valid identifier for the language of the element. -**Example**: +**Example:** [`YamlKeyValueRenameInputValidator`](%gh-ic%/plugins/yaml/src/org/jetbrains/yaml/refactoring/rename/YamlKeyValueRenameInputValidator.java) validating YAML language keys Implementations of `RenameInputValidator` or `RenameInputValidatorEx` are registered in the `com.intellij.renameInputValidator` extension point. @@ -59,7 +59,7 @@ Implementations of `RenameInputValidator` or `RenameInputValidatorEx` are regist Further customization of the Rename refactoring processing is possible on multiple levels. Providing a custom implementation of the [`RenameHandler`](%gh-ic%/platform/refactoring/src/com/intellij/refactoring/rename/RenameHandler.java) interface allows you to entirely replace the UI and workflow of the rename refactoring, and also to support renaming something which is not a [`PsiElement`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiElement.java) at all. -**Example**: +**Example:** [`RenameHandler`](%gh-ic%/plugins/properties/properties-resource-bundle-editor/src/com/intellij/lang/properties/refactoring/rename/ResourceBundleFromEditorRenameHandler.java) for renaming a resource bundle in the [Properties language plugin](%gh-ic%/plugins/properties) If you're okay with the standard UI but need to extend the default logic of renaming, you can provide an implementation of the [`RenamePsiElementProcessor`](%gh-ic%/platform/lang-impl/src/com/intellij/refactoring/rename/RenamePsiElementProcessor.java) interface. @@ -71,5 +71,5 @@ This allows you to: * Customize how a search for code references or text references is performed * etc. -**Example**: +**Example:** [`RenamePsiElementProcessor`](%gh-ic%/plugins/properties/src/com/intellij/lang/properties/refactoring/rename/RenamePropertyProcessor.java) for renaming a property in [Properties plugin language](%gh-ic%/plugins/properties) diff --git a/topics/reference_guide/custom_language_support/safe_delete_refactoring.md b/topics/reference_guide/custom_language_support/safe_delete_refactoring.md index 69fd98b09..f1430b9d0 100644 --- a/topics/reference_guide/custom_language_support/safe_delete_refactoring.md +++ b/topics/reference_guide/custom_language_support/safe_delete_refactoring.md @@ -30,5 +30,5 @@ In addition to that, to support _Safe Delete_, a plugin needs to implement two t If needed, it's possible to further customize how _Safe Delete_ is performed for a particular type of element (e.g., how references are searched) via [`SafeDeleteProcessorDelegate`](%gh-ic%/platform/lang-impl/src/com/intellij/refactoring/safeDelete/SafeDeleteProcessorDelegate.java). -**Example**: +**Example:** [`SafeDeleteProcessorDelegate`](%gh-ic%/plugins/properties/src/com/intellij/lang/properties/refactoring/PropertiesFilesSafeDeleteProcessor.java) implementation for [Properties language plugin](%gh-ic%/plugins/properties) diff --git a/topics/reference_guide/custom_language_support/spell_checking.md b/topics/reference_guide/custom_language_support/spell_checking.md index bf6c944a2..0b692272f 100644 --- a/topics/reference_guide/custom_language_support/spell_checking.md +++ b/topics/reference_guide/custom_language_support/spell_checking.md @@ -108,7 +108,7 @@ register it with the `com.intellij.spellchecker.bundledDictionaryProvider` exten allows providing (dynamic) dictionaries generated at runtime, e.g., downloaded from a server, created from project sources on-the-fly, etc. Register in `com.intellij.spellchecker.dictionary.runtimeDictionaryProvider` extension point. -**Example** +**Example:** [`PyPackagesDictionary`](%gh-ic%/python/src/com/jetbrains/python/packaging/PyPackagesDictionary.kt) ## Grammar Checks (Grazie plugin) diff --git a/topics/reference_guide/custom_language_support/structure_view.md b/topics/reference_guide/custom_language_support/structure_view.md index 5967ad8f3..30641f2a9 100644 --- a/topics/reference_guide/custom_language_support/structure_view.md +++ b/topics/reference_guide/custom_language_support/structure_view.md @@ -1,4 +1,4 @@ - + # Structure View @@ -26,7 +26,7 @@ The starting point for the structure view is the [`PsiStructureViewFactory`](%gh To reuse the IntelliJ Platform implementation of the `StructureView`, the plugin returns a [`TreeBasedStructureViewBuilder`](%gh-ic%/platform/editor-ui-api/src/com/intellij/ide/structureView/TreeBasedStructureViewBuilder.java) from its [`PsiStructureViewFactory.getStructureViewBuilder()`](%gh-ic%/platform/editor-ui-api/src/com/intellij/lang/PsiStructureViewFactory.java) method. As the builder model, the plugin can specify a subclass of [`TextEditorBasedStructureViewModel`](%gh-ic%/platform/editor-ui-api/src/com/intellij/ide/structureView/TextEditorBasedStructureViewModel.java), and by overriding methods of this subclass, it customizes the structure view for a specific language. -**Example**: +**Example:** [`StructureViewModel`](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/structureView/PropertiesFileStructureViewModel.java) for [Properties language plugin](%gh-ic%/plugins/properties) The main method to override is `getRoot()`, which returns the instance of a class implementing the [`StructureViewTreeElement`](%gh-ic%/platform/editor-ui-api/src/com/intellij/ide/structureView/StructureViewTreeElement.java) interface. diff --git a/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md b/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md index db2f3c028..c8f610714 100644 --- a/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md +++ b/topics/reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md @@ -37,7 +37,7 @@ To lookup external name for a setting in the IDE, use [UI Inspector](internal_ui The File | Export | Files or Selection to HTML feature uses the same syntax highlighting mechanism as the editor. Thus, it will work automatically for custom languages that provide a syntax highlighter. -**Examples**: +**Examples:** - [`ColorSettingsPage`](%gh-ic%/plugins/properties/src/com/intellij/lang/properties/PropertiesColorsPage.java) for [Properties language plugin](%gh-ic%/plugins/properties) - [Custom Language Support Tutorial: Color Settings Page](syntax_highlighter_and_color_settings_page.md) diff --git a/topics/reference_guide/frameworks_and_external_apis/external_system_integration.md b/topics/reference_guide/frameworks_and_external_apis/external_system_integration.md index a49aed60d..05cbd7b67 100644 --- a/topics/reference_guide/frameworks_and_external_apis/external_system_integration.md +++ b/topics/reference_guide/frameworks_and_external_apis/external_system_integration.md @@ -163,7 +163,7 @@ A particular external system settings UI contains the following items: It's recommended to extend from [`AbstractExternalProjectSettingsControl`](%gh-ic%/platform/external-system-impl/src/com/intellij/openapi/externalSystem/service/settings/AbstractExternalProjectSettingsControl.java) for implementing project-level settings control as it already handles some of them. -**Examples**: +**Examples:** * [`GradleSystemSettingsControl`](%gh-ic%/plugins/gradle/src/org/jetbrains/plugins/gradle/service/settings/GradleSystemSettingsControl.java) handling the General settings in Settings | Build, Execution, Deployment | Build Tools | Gradle * [`GradleProjectSettingsControl`](%gh-ic%/plugins/gradle/src/org/jetbrains/plugins/gradle/service/settings/GradleProjectSettingsControl.java) handling the selected Gradle project settings in Settings | Build, Execution, Deployment | Build Tools | Gradle diff --git a/topics/reference_guide/inspection_options.md b/topics/reference_guide/inspection_options.md index aa3e6f07a..360310fea 100644 --- a/topics/reference_guide/inspection_options.md +++ b/topics/reference_guide/inspection_options.md @@ -1,4 +1,4 @@ - + # Inspection Options @@ -131,7 +131,7 @@ Custom Swing controls can be provided by implementing and registering the implementation in the `com.intellij.inspectionCustomComponent` extension point. Please note that this API is still in experimental state and may be changed without preserving backward compatibility. -**Example**: +**Example:** [`JavaInspectionButtons`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/options/JavaInspectionButtons.java) providing buttons for configuring options in custom dialogs @@ -143,7 +143,7 @@ UI-based inspection options are provided by implementing a configuration panel u It returns the panel with option components that bind the provided values to the inspection class fields or other properties, similarly as in the [declarative](#declarative-inspection-options) approach. Note that since version 2023.1, this method is ignored if `InspectionProfileEntry.getOptionPane()` returns a non-empty panel. -**Example**: +**Example:** [`SizeReplaceableByIsEmptyInspection`](%gh-ic-223%/plugins/InspectionGadgets/src/com/siyeh/ig/style/SizeReplaceableByIsEmptyInspection.java) in version 2022.3, implemented using the UI-approach diff --git a/topics/reference_guide/jcef.md b/topics/reference_guide/jcef.md index ee08b4700..8be1dcd16 100644 --- a/topics/reference_guide/jcef.md +++ b/topics/reference_guide/jcef.md @@ -1,4 +1,4 @@ - + # Embedded Browser (JCEF) @@ -133,16 +133,16 @@ To access the client associated with a browser, call `JBCefBrowser.getJBCefClien JCEF API provides various event handler interfaces that allows handling a wide set of events emitted by the browser. Example handlers: - [`CefLoadHandler`](%gh-jcef-master%/org/cef/handler/CefLoadHandler.java) - handles browser loading events.
- **Example**: Implement `CefLoadHandler.onLoadEnd()` to [execute scripts](#executing-javascript) after document is loaded. + **Example:** Implement `CefLoadHandler.onLoadEnd()` to [execute scripts](#executing-javascript) after document is loaded. - [`CefDisplayHandler`](%gh-jcef-master%/org/cef/handler/CefDisplayHandler.java) - handles events related to browser display state.
- **Example**: Implement `CefDisplayHandler.onAddressChange()` to load project files in the browser when a local file link is clicked, or opening an external browser if an external link is clicked. + **Example:** Implement `CefDisplayHandler.onAddressChange()` to load project files in the browser when a local file link is clicked, or opening an external browser if an external link is clicked. - [`CefContextMenuHandler`](%gh-jcef-master%/org/cef/handler/CefContextMenuHandler.java) - handles context menu events.
- **Example**: Implement `CefContextMenuHandler.onBeforeContextMenu()` to change the items of the browser context menu. + **Example:** Implement `CefContextMenuHandler.onBeforeContextMenu()` to change the items of the browser context menu. - [`CefDownloadHandler`](%gh-jcef-master%/org/cef/handler/CefDownloadHandler.java) - file download events.
- **Example**: Implement `CefDownloadHandler.onBeforeDownload()` to enable downloading files in the embedded browser. + **Example:** Implement `CefDownloadHandler.onBeforeDownload()` to enable downloading files in the embedded browser. See [org.cef.handler](%gh-jcef-master%/org/cef/handler) package for all available handlers. diff --git a/topics/reference_guide/settings_guide.md b/topics/reference_guide/settings_guide.md index b49898cb4..2dad4b04a 100644 --- a/topics/reference_guide/settings_guide.md +++ b/topics/reference_guide/settings_guide.md @@ -198,6 +198,6 @@ In that case the IntelliJ Platform calls `ConfigurableProvider.createConfigurabl By choosing not to provide a `Configuration` implementation in some circumstances, the `ConfigurableProvider` opts out of the Settings display and modification process. The use of `ConfigurableProvider` as a basis for a Settings implementation is declared using [attributes](#table-of-attributes) in the EP declaration. -**Examples**: +**Examples:** - [`RunToolbarSettingsConfigurableProvider`](%gh-ic%/platform/execution-impl/src/com/intellij/execution/runToolbar/RunToolbarSettingsConfigurableProvider.kt) - [`VcsManagerConfigurableProvider`](%gh-ic%/platform/vcs-impl/src/com/intellij/openapi/vcs/configurable/VcsManagerConfigurableProvider.java) diff --git a/topics/tutorials/file_and_code_templates/providing_file_templates.md b/topics/tutorials/file_and_code_templates/providing_file_templates.md index 6257b4768..15ebcfac1 100644 --- a/topics/tutorials/file_and_code_templates/providing_file_templates.md +++ b/topics/tutorials/file_and_code_templates/providing_file_templates.md @@ -1,4 +1,4 @@ - + # Providing File and Code Templates @@ -63,7 +63,7 @@ To include file templates in the Other section of the + # Using File Templates Programmatically @@ -33,7 +33,7 @@ It is possible to control a file template's visibility and its available propert [`CreateFromTemplateHandler`](%gh-ic%/platform/lang-impl/src/com/intellij/ide/fileTemplates/CreateFromTemplateHandler.java) implementation registered in the `com.intellij.createFromTemplateHandler` EP. -**Example**: +**Example:** [`JavaCreateFromTemplateHandler`](%gh-ic%/java/java-impl/src/com/intellij/ide/fileTemplates/JavaCreateFromTemplateHandler.java) ### Exposing File Templates from the Other Category @@ -116,7 +116,7 @@ Internal templates can be exposed in the Files category by ad ``` -**Example**: +**Example:** [`NewKotlinFileAction`](%gh-ic%/plugins/kotlin/kotlin.ide/src/org/jetbrains/kotlin/idea/actions/NewKotlinFileAction.kt) for Kotlin files creation action. ## Improving "Save File as Template…" Action @@ -128,5 +128,5 @@ It can be achieved by implementing the [`SaveFileAsTemplateHandler`](%gh-ic%/platform/lang-impl/src/com/intellij/ide/actions/SaveFileAsTemplateHandler.java) and registering it via the `com.intellij.saveFileAsTemplateHandler` EP. -**Example**: +**Example:** [`SaveJavaAsTemplateHandler`](%gh-ic%/java/java-impl/src/com/intellij/ide/fileTemplates/SaveJavaAsTemplateHandler.java) replacing existing class and package names with `${NAME}` and `${PACKAGE_NAME}` properties placeholders respectively. diff --git a/topics/user_interface_components/popups.md b/topics/user_interface_components/popups.md index ec6813426..85fa675e1 100644 --- a/topics/user_interface_components/popups.md +++ b/topics/user_interface_components/popups.md @@ -1,4 +1,4 @@ - + # Popups @@ -14,10 +14,10 @@ The most commonly used methods are: | Method | Description | |---------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `createComponentPopupBuilder()` |

Generic, allows showing any [Swing](https://docs.oracle.com/javase/tutorial/uiswing/start/index.html) component.

**Example**: [`IntentionPreviewPopupUpdateProcessor`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/preview/IntentionPreviewPopupUpdateProcessor.kt) creating a popup rendering the intention preview.

| -| `createPopupChooserBuilder()` |

For choosing one or more items from a plain `java.util.List`.

**Example**: [`ShowMessageHistoryAction`](%gh-ic%/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/ShowMessageHistoryAction.kt) creating a popup with recent commit messages history in the commit message text area.

| -| `createConfirmation()` |

For choosing between two options, and performing different actions depending on which option is selected.

**Example**: [`VariableInplaceRenamer`](%gh-ic%/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java) creating confirmation popup after invalid variable name is provided in the inplace rename action.

| -| `createActionGroupPopup()` |

Show actions from an [Action Group](grouping_action.md) and executes the action selected by the user.

**Example**: [`ShowRecentFindUsagesGroup`](%gh-ic%/platform/lang-impl/src/com/intellij/find/impl/ShowRecentFindUsagesGroup.java) invoked via Edit / Find Usages / Recent Find Usages and showing recent find usages group popup.

| +| `createComponentPopupBuilder()` |

Generic, allows showing any [Swing](https://docs.oracle.com/javase/tutorial/uiswing/start/index.html) component.

**Example:** [`IntentionPreviewPopupUpdateProcessor`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/preview/IntentionPreviewPopupUpdateProcessor.kt) creating a popup rendering the intention preview.

| +| `createPopupChooserBuilder()` |

For choosing one or more items from a plain `java.util.List`.

**Example:** [`ShowMessageHistoryAction`](%gh-ic%/platform/vcs-impl/src/com/intellij/openapi/vcs/actions/ShowMessageHistoryAction.kt) creating a popup with recent commit messages history in the commit message text area.

| +| `createConfirmation()` |

For choosing between two options, and performing different actions depending on which option is selected.

**Example:** [`VariableInplaceRenamer`](%gh-ic%/platform/lang-impl/src/com/intellij/refactoring/rename/inplace/VariableInplaceRenamer.java) creating confirmation popup after invalid variable name is provided in the inplace rename action.

| +| `createActionGroupPopup()` |

Show actions from an [Action Group](grouping_action.md) and executes the action selected by the user.

**Example:** [`ShowRecentFindUsagesGroup`](%gh-ic%/platform/lang-impl/src/com/intellij/find/impl/ShowRecentFindUsagesGroup.java) invoked via Edit / Find Usages / Recent Find Usages and showing recent find usages group popup.

| ### Action Groups