diff --git a/topics/_shared/snippets.topic b/topics/_shared/snippets.topic index a0a16c10d..9c005d9e6 100644 --- a/topics/_shared/snippets.topic +++ b/topics/_shared/snippets.topic @@ -226,4 +226,8 @@ summary="Browse usages in existing implementations of open-source plugins"> %ep% extension point + + %ep% + diff --git a/topics/reference_guide/custom_language_support/additional_minor_features.md b/topics/reference_guide/custom_language_support/additional_minor_features.md index fec4b62f3..2de2a9c2f 100644 --- a/topics/reference_guide/custom_language_support/additional_minor_features.md +++ b/topics/reference_guide/custom_language_support/additional_minor_features.md @@ -6,12 +6,10 @@ A number of commonly used minor features are listed in the following format: -_EP: `fully.qualified.extensionPointName`_ — Extension Point Name (must be specified in [plugin.xml](plugin_configuration_file.md)) +_EP: `fully.qualified.extensionPointName`_ — Extension Point Name (must be specified in [plugin.xml](plugin_configuration_file.md)). Click to browse usages in existing implementations of open-source plugins. _`com.extensionPoint.class`_ _description text_ — Extension Point class/interface to provide functionality -_- Sample 1_ - Sample implementation - > See also [](intellij_platform_extension_point_list.md#langextensionpointsxml) to discover more Language-related Extension Points as well as general guide [](explore_api.md). > {title="Locating more Language EPs"} @@ -20,7 +18,7 @@ _- Sample 1_ - Sample implementation ### Brace Matching -EP: `com.intellij.lang.braceMatcher` +EP: [`PairedBraceMatcher`](%gh-ic%/platform/analysis-api/src/com/intellij/lang/PairedBraceMatcher.java) returns an array of brace pairs ([`BracePair`](%gh-ic%/platform/analysis-api/src/com/intellij/lang/BracePair.java)) specifying the characters for the opening and closing braces and the lexer token types for these characters. @@ -36,30 +34,30 @@ See also [](#recognizing-complex-multi-block-expressions). +EP: + If the brace matching is "too heavy" and should not be executed in [EDT](threading_model.md), implement -[`HeavyBraceHighlighter`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HeavyBraceHighlighter.java) -and register in . +[`HeavyBraceHighlighter`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HeavyBraceHighlighter.java). ### Quote Handling -EP: `com.intellij.lang.quoteHandler` +EP: To support Insert pair quote feature, provide [`QuoteHandler`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/editorActions/QuoteHandler.java). In most cases, [`SimpleTokenSetQuoteHandler`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/editorActions/SimpleTokenSetQuoteHandler.java) base implementation will be suitable. ### Comment Code -EP: `com.intellij.lang.commenter` +EP: [`Commenter`](%gh-ic%/platform/core-api/src/com/intellij/lang/Commenter.java) returns the prefix for the line comment, and the prefix and suffix for the block comment if supported by the language. For more complex logic, use [`SelfManagingCommenter`](%gh-ic%/platform/core-api/src/com/intellij/codeInsight/generation/SelfManagingCommenter.java). -- [`Commenter`](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/PropertiesCommenter.java) for [Properties language plugin](%gh-ic%/plugins/properties) - [Custom Language Support Tutorial: Commenter](commenter.md) ### Code Folding -EP: `com.intellij.lang.foldingBuilder` +EP: [`FoldingBuilder`](%gh-ic%/platform/core-api/src/com/intellij/lang/folding/FoldingBuilder.java) returns the list of foldable text ranges (as an array of [`FoldingDescriptor`](%gh-ic%/platform/core-api/src/com/intellij/lang/folding/FoldingDescriptor.java) objects), the replacement text which is shown for each range when it is folded, and the default state of each folding region (folded or unfolded). @@ -67,41 +65,38 @@ EP: `com.intellij.lang.foldingBuilder` ### Join Lines -EP: `com.intellij.joinLinesHandler` +EP: [`JoinLinesHandlerDelegate`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/editorActions/JoinLinesHandlerDelegate.java) allows extending support smart/semantic Edit | Join Lines (e.g., String literal split on multiple lines). ### Smart Enter -EP: `com.intellij.lang.smartEnterProcessor` +EP: [`SmartEnterProcessor`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/editorActions/smartEnter/SmartEnterProcessor.java) handles Edit | Complete Statement (e.g., autocomplete missing semicolon/parentheses). ### Move Element Left/Right -EP: `com.intellij.moveLeftRightHandler` +EP: Return children of given element from [`MoveElementLeftRightHandler`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/editorActions/moveLeftRight/MoveElementLeftRightHandler.java) for Code | Move Element Left|Right, e.g., method call parameters. Alternatively, implement [`PsiListLikeElement`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiListLikeElement.java) in PSI element. ### Move Statements Up and Down in the Editor -EP: `com.intellij.statementUpDownMover` +EP: [`StatementUpDownMover`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/editorActions/moveUpDown/StatementUpDownMover.java) allows for customizing the behavior of moving statements up and down. This can be used to keep code syntactically correct when moving code in the editor, e.g. when moving a variable declaration. -- [`DeclarationMover`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/editorActions/moveUpDown/DeclarationMover.java) - ### Splitting and Joining List Constructs -EP: `com.intellij.listSplitJoinContext` +EP: [`ListSplitJoinContext`](%gh-ic%/platform/lang-impl/src/com/intellij/openapi/editor/actions/lists/ListSplitJoinContext.kt) -needs to be implemented to define the exact behavior of splitting and joining list-like constructs -in a language. +needs to be implemented to define the exact behavior of splitting and joining list-like constructs in a language. The UI will show implementations of this EP as an [intention action](https://www.jetbrains.com/help/idea/intention-actions.html) at appropriate locations. @@ -113,7 +108,7 @@ for their implementation. ### Recognizing Complex Multi-Block Expressions -EP: `com.intellij.codeBlockSupportHandler` +EP: [`CodeBlockSupportHandler`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/highlighting/CodeBlockSupportHandler.java) allows providing text ranges for more complex code blocks like, e.g., in `if`/`elsif`/`else` blocks. @@ -124,13 +119,13 @@ See also [](#brace-matching). ### Reference Injection -EP: `com.intellij.referenceInjector` +EP: [`ReferenceInjector`](%gh-ic%/platform/analysis-api/src/com/intellij/psi/injection/ReferenceInjector.java) allows users to inject pre-defined references (e.g., "Encoding", "File Reference") into `PsiLanguageInjectionHost` elements (IntelliLang plugin required). ### Prevent Error Highlighting of Files -EP: `com.intellij.problemHighlightFilter`, `com.intellij.problemFileHighlightFilter` +EP: , [`ProblemHighlightFilter`](%gh-ic%/platform/analysis-api/src/com/intellij/codeInsight/daemon/ProblemHighlightFilter.java) and the (which implements @@ -140,12 +135,9 @@ the current project scope. Note that these filters should be permissive and only prevent highlighting for files that are absolutely known to be outside the scope. -- [`JavaProblemHighlightFilter`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/daemon/JavaProblemHighlightFilter.java) -- [`PyProblemFileHighlightFilter`](%gh-ic%/python/src/com/jetbrains/python/codeInsight/PyProblemFileHighlightFilter.java) - ### Semantic Highlight Usages -EP: `com.intellij.highlightUsagesHandlerFactory` +EP: [`HighlightUsagesHandlerFactory`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/highlighting/HighlightUsagesHandlerFactory.java) allows highlighting e.g., Exit Points or Exceptions. Can be [](indexing_and_psi_stubs.md#DumbAwareAPI) (2024.3+). @@ -154,46 +146,40 @@ Can be [](indexing_and_psi_stubs.md#DumbAwareAPI) (2024.3+). ### Context Info -EP: `com.intellij.declarationRangeHandler` +EP: [`DeclarationRangeHandler`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/hint/DeclarationRangeHandler.java) provides View | Context Info for custom languages with structure view implementation based on a [`TreeBasedStructureViewBuilder`](%gh-ic%/platform/editor-ui-api/src/com/intellij/ide/structureView/TreeBasedStructureViewBuilder.java). ### Breadcrumbs -EP: `com.intellij.breadcrumbsInfoProvider` +EP: [`BreadcrumbsProvider`](%gh-ic%/platform/editor-ui-api/src/com/intellij/ui/breadcrumbs/BreadcrumbsProvider.java) allows for language-specific [breadcrumbs](https://www.jetbrains.com/help/idea/navigating-through-the-source-code.html#editor_breadcrumbs). [Sticky Lines](https://www.jetbrains.com/help/idea/sticky-lines.html) feature also uses this data. -- [`GroovyBreadcrumbsInfoProvider`](%gh-ic%/plugins/groovy/src/org/jetbrains/plugins/groovy/editor/GroovyBreadcrumbsInfoProvider.kt) - ## IDE Integration ### TODO View [`ParserDefinition.getCommentTokens()`](%gh-ic%/platform/core-api/src/com/intellij/lang/ParserDefinition.java) must return the set of tokens treated as comments to populate the TODO tool window. -### Spellchecking - -Moved to [](spell_checking.md). - ### Color Preview/Chooser -EP: `com.intellij.colorProvider` +EP: [`ElementColorProvider`](%gh-ic%/platform/lang-api/src/com/intellij/openapi/editor/ElementColorProvider.java) renders gutter icon for an element containing color information. ### File Includes -EP: `com.intellij.include.provider` +EP: [`FileIncludeProvider`](%gh-ic%/platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeProvider.java) provides information about _include_ statements resolving to files (e.g., `` in XML). Including/included files can then be obtained via [`FileIncludeManager`](%gh-ic%/platform/lang-api/src/com/intellij/psi/impl/include/FileIncludeManager.java). ### Plain Text Completion -EP: `com.intelllij.completion.plainTextSymbol` +EP: [`PlainTextSymbolCompletionContributor`](%gh-ic%/platform/lang-api/src/com/intellij/codeInsight/completion/PlainTextSymbolCompletionContributor.java) provides a simple way to extract lookup elements from a file so that users have completion available @@ -201,7 +187,7 @@ in, e.g., plain text editors like VCS commit messages. ### Reader Mode -EP: `com.intellij.readerModeMatcher` +EP: [`ReaderModeMatcher`](%gh-ic%/platform/editor-ui-api/src/com/intellij/codeInsight/actions/ReaderModeMatcher.kt) provides a way to decide if files are shown in the correct mode: reader mode vs. normal editor mode. @@ -211,7 +197,7 @@ to get familiar with reader mode. ### Background Colors for Editors and Project View -EP: `com.intellij.editorTabColorProvider` +EP: [`EditorTabColorProvider`](%gh-ic%/platform/ide-core-impl/src/com/intellij/openapi/fileEditor/impl/EditorTabColorProvider.java) allows for the modification of the background colors for specific files. @@ -219,24 +205,19 @@ If access to indexes is not required, it can be marked [dumb aware](indexing_and ### Custom Names and Tooltips for Editor Tabs -EP: `com.intellij.editorTabTitleProvider` +EP: [`EditorTabTitleProvider`](%gh-ic%/platform/ide-core-impl/src/com/intellij/openapi/fileEditor/impl/EditorTabTitleProvider.kt) allows for specifying custom names and tooltips displayed in the title of editor tabs. If access to indexes is not required, it can be marked [dumb aware](indexing_and_psi_stubs.md#DumbAwareAPI). -- [`GradleEditorTabTitleProvider`](%gh-ic%/plugins/gradle/src/org/jetbrains/plugins/gradle/util/GradleEditorTabTitleProvider.kt) - ### Provide Fully Qualified Names (FQN) for Elements -EP: `com.intellij.ide.actions.QualifiedNameProvider` +EP: [`QualifiedNameProvider`](%gh-ic%/platform/refactoring/src/com/intellij/ide/actions/QualifiedNameProvider.java) provides features like copying and pasting references of FQN for, e.g., classes, functions, or methods. -Therefore, the `QualifiedNameProvider` implementation needs to provide logic to convert from and to -FQN. - -- [`PyQualifiedNameProvider`](%gh-ic%/python/src/com/jetbrains/python/actions/PyQualifiedNameProvider.java) +Therefore, the `QualifiedNameProvider` implementation needs to provide logic to convert from and to FQN. ### Customized "Copy Path" @@ -249,10 +230,10 @@ Register the action with the popup menu group ` [`TestSourcesFilter`](%gh-ic%/platform/projectModel-api/src/com/intellij/openapi/roots/TestSourcesFilter.java) -allows for telling the IDE that a file is a test file, even it's not located in a directory marked as +allows for telling the IDE that a file is a test file; even it's not located in a directory marked as test root. This can be used in situations where test files are located next to source files. If these files can be distinguished either by filename or content from source files, implementing this @@ -262,17 +243,15 @@ EP will mark them as test files for the IDE. ### Naming Suggestions -EP: `com.intellij.nameSuggestionProvider` +EP: -[`NameSuggestionProvider`](%gh-ic%/platform/refactoring/src/com/intellij/refactoring/rename/NameSuggestionProvider.java) provides name suggestions for the given element, e.g., for Rename refactoring. +[`NameSuggestionProvider`](%gh-ic%/platform/refactoring/src/com/intellij/refactoring/rename/NameSuggestionProvider.java) provides name suggestions for the given element, e.g., for [Rename refactoring](rename_refactoring.md). ### Suggesting Rename and Change Signature Refactorings -EP: `com.intellij.suggestedRefactoringSupport` +EP: [`SuggestedRefactoringSupport`](%gh-ic%/platform/lang-api/src/com/intellij/refactoring/suggested/SuggestedRefactoringSupport.kt) provides functionality for suggesting rename and change signature refactorings for custom languages. -- [`KotlinSuggestedRefactoringSupport`](%gh-ic%/plugins/kotlin/idea/src/org/jetbrains/kotlin/idea/refactoring/suggested/KotlinSuggestedRefactoringSupport.kt) -