extends JBFoo implements Disposable {
- @Override
- public void dispose() {
- myFooManager.unregister(this);
- myDetachedToolWindowManager.unregister(myFileEditor);
- KeyboardFocusManager.getCurrentKeyboardFocusManager().removePropertyChangeListener("focusOwner", myMyPropertyChangeListener);
- setToolContext(null);
- }
+ public Foo(@NotNull Project project,
+ @NotNull String name,
+ @Nullable FileEditor fileEditor,
+ @NotNull Disposable parentDisposable) {
+ this(project, name, fileEditor, InitParams.createParams(project),
+ DetachedToolWindowManager.getInstance(project));
+ Disposer.register(parentDisposable, this);
}
+
+ @Override
+ public void dispose() {
+ myFooManager.unregister(this);
+ myDetachedToolWindowManager.unregister(myFileEditor);
+ KeyboardFocusManager.getCurrentKeyboardFocusManager()
+ .removePropertyChangeListener("focusOwner", myMyPropertyChangeListener);
+ setToolContext(null);
+ }
+}
```
A lot of code setting-up all the conditions requiring release in `dispose()` has been omitted for simplicity.
diff --git a/topics/basics/getting_started/theme/creating_theme_project.md b/topics/basics/getting_started/theme/creating_theme_project.md
index 160675a3b..04741f381 100644
--- a/topics/basics/getting_started/theme/creating_theme_project.md
+++ b/topics/basics/getting_started/theme/creating_theme_project.md
@@ -1,6 +1,6 @@
-[//]: # (title: Creating a Theme Project)
+
-
+# Creating a Theme Project
Creating a theme plugin project with Plugin DevKit wizard and generated project overview.
@@ -38,7 +38,8 @@ my_theme
- META-INF directory with:
- [plugin.xml](plugin_configuration_file.md) configuration file containing preconfigured theme provider
- - pluginIcon.svg file that is a [plugin logo](plugin_icon_file.md)
+ - pluginIcon.svg file that is a [plugin logo](plugin_icon_file.md)
+
It is recommended to replace it with a custom icon.
- my_theme.theme.json - a minimal [theme description file](themes_customize.md#introduction-to-theme-description-file-syntax)
- my_theme.iml - [IntelliJ IDEA Module](https://www.jetbrains.com/help/idea/creating-and-managing-modules.html) configuration file
diff --git a/topics/basics/getting_started/theme/developing_themes.md b/topics/basics/getting_started/theme/developing_themes.md
index 2a1d9b05b..f8035d57f 100644
--- a/topics/basics/getting_started/theme/developing_themes.md
+++ b/topics/basics/getting_started/theme/developing_themes.md
@@ -1,6 +1,6 @@
-[//]: # (title: Developing a Theme)
+
-
+# Developing a Theme
Develop an IntelliJ Platform-based IDE theme using Plugin DevKit.
diff --git a/topics/basics/getting_started/theme/running_and_debugging_a_theme.md b/topics/basics/getting_started/theme/running_and_debugging_a_theme.md
index 565c03639..fd5e5f430 100644
--- a/topics/basics/getting_started/theme/running_and_debugging_a_theme.md
+++ b/topics/basics/getting_started/theme/running_and_debugging_a_theme.md
@@ -1,6 +1,6 @@
-[//]: # (title: Running and Debugging a Theme)
+
-
+# Running and Debugging a Theme
Running and debugging a theme in the actual IDE instance.
diff --git a/topics/basics/getting_started/theme/setting_up_theme_environment.md b/topics/basics/getting_started/theme/setting_up_theme_environment.md
index 60a2b4381..3c289fe89 100644
--- a/topics/basics/getting_started/theme/setting_up_theme_environment.md
+++ b/topics/basics/getting_started/theme/setting_up_theme_environment.md
@@ -1,6 +1,6 @@
-[//]: # (title: Setting Up a Development Environment)
+
-
+# Setting Up a Development Environment
Setting up a development environment required for developing a theme.
@@ -29,7 +29,7 @@ Note that building the checked-out sources is not required in this case.
> For more information about SDKs, see [SDKs section](https://www.jetbrains.com/help/idea/working-with-sdks.html) in the IntelliJ IDEA Web Help.
-### Download IntelliJ-based IDE
+### Download IntelliJ-Based IDE
To see the effects of the developed plugin in real IDE, it is required to run the plugin in an [](ide_development_instance.md).
In most cases, it is enough to download and use _[IntelliJ IDEA](https://www.jetbrains.com/idea/download/) Community Edition_.
diff --git a/topics/basics/getting_started/theme/themes_customize.md b/topics/basics/getting_started/theme/themes_customize.md
index 259ea95fa..10441e3e6 100644
--- a/topics/basics/getting_started/theme/themes_customize.md
+++ b/topics/basics/getting_started/theme/themes_customize.md
@@ -1,6 +1,8 @@
-[//]: # (title: Customizing Themes - Icons and UI Controls)
+
-
+# Customizing Themes - Icons and UI Controls
+
+Customizing UI controls and icons in a theme plugin.
@@ -8,8 +10,6 @@
-Customizing UI controls and icons in a theme plugin.
-
A theme is customized by adding information to the theme description file that overrides the base (_Light_ or _Darcula_) theme.
For plugin developers, [Exposing Theme Metadata](themes_metadata.md) discusses the format of customization keys and information about how to provide it to Theme authors.
@@ -123,13 +123,13 @@ The file format for icons is SVG.
The [JetBrains Platform UI Guideline for Icons](https://jetbrains.design/intellij/principles/icons/) has detailed specifications for icons.
An icon replacement is described within the `icon {}` section of a Theme description file.
-Note that icon replacement key-value pairs appear outside of the `ColorPalette` section.
+Note that icon replacement key-value pairs appear outside the `ColorPalette` section.
For icon substitutions, the `key` is the path to the default icon image.
This path is derived from the `AllIcons.[Group].[IconName]` path in icon section reported by the [UI Inspector](internal_ui_inspector.md).
For example, the _Build_ (hammer) icon in the toolbar has the path `Allcons.Actions.Compile` as reported by the UI Inspector.
-Therefore the `key` for the _Build_ icon is `/actions/compile.svg`.
+Therefore, the `key` for the _Build_ icon is `/actions/compile.svg`.
The `value` is the replacement icon's file name, located in the `resources` folder of the theme plugin project:
```json
diff --git a/topics/basics/getting_started/theme/themes_getting_started.md b/topics/basics/getting_started/theme/themes_getting_started.md
index 18d5600b7..eb568d355 100644
--- a/topics/basics/getting_started/theme/themes_getting_started.md
+++ b/topics/basics/getting_started/theme/themes_getting_started.md
@@ -1,6 +1,6 @@
-[//]: # (title: Getting Started)
+
-
+# Getting Started
Customizing IDE UI by developing a custom theme.
diff --git a/topics/basics/plugin_structure/plugin_configuration_file.md b/topics/basics/plugin_structure/plugin_configuration_file.md
index c41837939..0b879cb83 100644
--- a/topics/basics/plugin_structure/plugin_configuration_file.md
+++ b/topics/basics/plugin_structure/plugin_configuration_file.md
@@ -1,9 +1,9 @@
-[//]: # (title: Plugin Configuration File)
+
+
+# Plugin Configuration File
-
-
Plugin configuration file contains all the information about the plugin, as well as all registered extensions, actions, listeners, etc.
The plugin.xml configuration file contains all the information about the plugin, which is displayed in the [plugins settings dialog](https://www.jetbrains.com/help/idea/managing-plugins.html), and all registered extensions, actions, listeners, etc.
diff --git a/topics/basics/plugin_structure/plugin_listeners.md b/topics/basics/plugin_structure/plugin_listeners.md
index 9dc2937b2..098f103e8 100644
--- a/topics/basics/plugin_structure/plugin_listeners.md
+++ b/topics/basics/plugin_structure/plugin_listeners.md
@@ -1,6 +1,6 @@
-[//]: # (title: Listeners)
+
-
+# Listeners
Listeners allow subscription to application and project events.
diff --git a/topics/basics/psi_cookbook.md b/topics/basics/psi_cookbook.md
index 2be2f7d5e..e019e774b 100644
--- a/topics/basics/psi_cookbook.md
+++ b/topics/basics/psi_cookbook.md
@@ -1,6 +1,6 @@
-[//]: # (title: PSI Cookbook)
+
-
+# PSI Cookbook
@@ -9,7 +9,7 @@ This page gives recipes for the most common operations for working with the PSI
Unlike [Developing Custom Language Plugins](custom_language_support.md), it is about working with the PSI of existing languages (such as Java).
-> Please see also [](psi_performance.md).
+> See also the [](psi_performance.md) section.
>
## General
@@ -58,7 +58,7 @@ Unlike [Developing Custom Language Plugins](custom_language_support.md), it is a
```java
PsiJavaFile javaFile = (PsiJavaFile) psiClass.getContainingFile();
PsiPackage psiPackage = JavaPsiFacade.getInstance(project)
- .findPackage(javaFile.getPackageName());
+ .findPackage(javaFile.getPackageName());
```
or
diff --git a/topics/basics/testing_plugins/test_project_and_testdata_directories.md b/topics/basics/testing_plugins/test_project_and_testdata_directories.md
index 38d5e9a45..023734f52 100644
--- a/topics/basics/testing_plugins/test_project_and_testdata_directories.md
+++ b/topics/basics/testing_plugins/test_project_and_testdata_directories.md
@@ -1,7 +1,7 @@
-[//]: # (title: Test Project and Testdata Directories)
-
+# Test Project and Testdata Directories
+
Adding test data to test projects used during tests execution.
The test fixture creates a *test project* environment.
@@ -48,6 +48,7 @@ These methods copy the specified files from the testdata directory
>
### Special Markup
+
When a file is opened in the in-memory editor, special markup in the file content can specify the caret position or selection.
You can use one of the following markers:
diff --git a/topics/products/idea/spring_api.md b/topics/products/idea/spring_api.md
index 0f483ce31..8243d7db8 100644
--- a/topics/products/idea/spring_api.md
+++ b/topics/products/idea/spring_api.md
@@ -1,6 +1,6 @@
-[//]: # (title: Spring API)
+
-
+# Spring API
@@ -103,7 +103,7 @@ _Version 14_: `com.intellij.spring.model.utils.SpringModelSearchers#findBeans`
_Version 16_: note deprecation of `SpringModelSearchParameters.BeanClass#withInheritors(GlobalSearchScope)`
-#### Find out if Bean with Given Name/Type Exists
+#### Check If a Bean with Given Name/Type Exists
_Version 14_: `com.intellij.spring.model.utils.SpringModelSearchers#doesBeanExist` (please note deprecated methods)
#### Mark Bean as Infrastructure Bean
@@ -171,7 +171,7 @@ Spring Boot API allows extending/accessing Spring Boot specific support in the I
>
{style="warning"}
-### Setting up
+### Setting Up
[Add dependency](plugin_dependencies.md) to bundled Spring Boot plugin with ID `com.intellij.spring.boot`.
Sources for Spring Boot API are available in $IDEA_HOME$/lib/src/src_spring-boot-openapi.zip.
diff --git a/topics/reference_guide/custom_language_support.md b/topics/reference_guide/custom_language_support.md
index f7c9d5b2f..2b45665c4 100644
--- a/topics/reference_guide/custom_language_support.md
+++ b/topics/reference_guide/custom_language_support.md
@@ -1,6 +1,6 @@
-[//]: # (title: Custom Language Support)
+
-
+# Custom Language Support
Supporting custom languages overview.
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 9f70ba2af..4868c744d 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
@@ -1,7 +1,7 @@
-[//]: # (title: Code Inspections and Intentions)
-
+# Code Inspections and Intentions
+
Introduction to analysing the code and providing quick fixes for the found issues.
diff --git a/topics/reference_guide/custom_language_support/implementing_lexer.md b/topics/reference_guide/custom_language_support/implementing_lexer.md
index b848edd45..8c36806aa 100644
--- a/topics/reference_guide/custom_language_support/implementing_lexer.md
+++ b/topics/reference_guide/custom_language_support/implementing_lexer.md
@@ -1,10 +1,8 @@
-[//]: # (title: Implementing Lexer)
+
-
+# Implementing Lexer
-
-A Lexer defines how a file's contents are broken into tokens.
-
+A Lexer defines how a file's contents are broken into tokens.
The lexer, or [lexical analyzer](https://en.wikipedia.org/wiki/Lexical_analysis), defines how a file's contents are broken into tokens.
The lexer serves as a foundation for nearly all features of custom language plugins, from basic syntax highlighting to advanced code analysis features.
diff --git a/topics/reference_guide/custom_language_support/symbols.md b/topics/reference_guide/custom_language_support/symbols.md
index 5a907342a..5f4f1442d 100644
--- a/topics/reference_guide/custom_language_support/symbols.md
+++ b/topics/reference_guide/custom_language_support/symbols.md
@@ -1,6 +1,6 @@
-[//]: # (title: Symbols)
+
-
+# Symbols
> This API is available starting from 2020.3 and is currently in development and thus in an experimental state.
>
diff --git a/topics/reference_guide/intellij_artifacts.md b/topics/reference_guide/intellij_artifacts.md
index 557a92003..173da3742 100644
--- a/topics/reference_guide/intellij_artifacts.md
+++ b/topics/reference_guide/intellij_artifacts.md
@@ -1,7 +1,7 @@
-[//]: # (title: IntelliJ Platform Artifacts Repositories)
-
+# IntelliJ Platform Artifacts Repositories
+
Overview of the repositories hosting artifacts related to the IntelliJ Platform.
> When using additional repositories, make sure to use HTTPS always.
@@ -75,7 +75,7 @@ The table below shows some example module names and their corresponding groupId
| intellij.xml.impl | com.jetbrains.intellij.xml | xml-impl |
The artifact _version_ can be specified in one of several ways because each artifact [at the Repository URLs](#specify-the-repository-url) has multiple versions available:
-* Specify release build versions as _MAJOR[.MINOR][.FIX]_. For example `14`, or `14.1`, or `14.1.1`
+* Specify release build versions as _MAJOR\[.MINOR]\[.FIX]_. For example `14`, or `14.1`, or `14.1.1`
* Snapshot versions are specified as:
* The snapshot of the most recent branch build is specified as _BRANCH-EAP-SNAPSHOT_. For example, `193-EAP-SNAPSHOT`.
There is only one of this type of build for each branch of each product.
diff --git a/topics/reference_guide/messaging_infrastructure.md b/topics/reference_guide/messaging_infrastructure.md
index 0dd3577af..994d8d563 100644
--- a/topics/reference_guide/messaging_infrastructure.md
+++ b/topics/reference_guide/messaging_infrastructure.md
@@ -1,7 +1,7 @@
-[//]: # (title: Messaging Infrastructure)
-
+# Messaging Infrastructure
+
Subscribing and publishing messages via message bus.
## Purpose
@@ -54,7 +54,7 @@ Manages all subscriptions for particular client within particular bus.
* it's possible to specify *default handler* and subscribe to the target topic without explicitly provided callback.
Connection will use that *default handler* when storing *(topic-handler)* mapping;
* it's possible to explicitly release acquired resources (*disconnect()* method).
- Also it can be plugged to standard semi-automatic disposing ([`Disposable`](%gh-ic%/platform/util/src/com/intellij/openapi/Disposable.java));
+ Also, it can be plugged to standard semi-automatic disposing ([`Disposable`](%gh-ic%/platform/util/src/com/intellij/openapi/Disposable.java));
### Putting Altogether
@@ -63,10 +63,11 @@ Manages all subscriptions for particular client within particular bus.
```java
public interface ChangeActionNotifier {
- Topic CHANGE_ACTION_TOPIC = Topic.create("custom name", ChangeActionNotifier.class);
+ Topic CHANGE_ACTION_TOPIC =
+ Topic.create("custom name", ChangeActionNotifier.class);
- void beforeAction(Context context);
- void afterAction(Context context);
+ void beforeAction(Context context);
+ void afterAction(Context context);
}
```
@@ -80,16 +81,17 @@ public interface ChangeActionNotifier {
```java
public void init(MessageBus bus) {
- bus.connect().subscribe(ActionTopics.CHANGE_ACTION_TOPIC, new ChangeActionNotifier() {
- @Override
- public void beforeAction(Context context) {
+ bus.connect().subscribe(ActionTopics.CHANGE_ACTION_TOPIC,
+ new ChangeActionNotifier() {
+ @Override
+ public void beforeAction(Context context) {
// Process 'before action' event.
- }
- @Override
- public void afterAction(Context context) {
+ }
+ @Override
+ public void afterAction(Context context) {
// Process 'after action' event.
- }
- });
+ }
+ });
}
```
@@ -99,14 +101,14 @@ public void init(MessageBus bus) {
```java
public void doChange(Context context) {
- ChangeActionNotifier publisher = myBus.syncPublisher(ActionTopics.CHANGE_ACTION_TOPIC);
- publisher.beforeAction(context);
- try {
- // Do action
- // ...
- } finally {
- publisher.afterAction(context)
- }
+ ChangeActionNotifier publisher =
+ myBus.syncPublisher(ActionTopics.CHANGE_ACTION_TOPIC);
+ publisher.beforeAction(context);
+ try {
+ // do action
+ } finally {
+ publisher.afterAction(context);
+ }
}
```
@@ -173,7 +175,7 @@ Let's see what happens if someone sends a message to the target topic:
* _handler2_ receives _message2_;
* _handler1_ receives _message2_;
-## Tips'n'tricks
+## Tips and Tricks
### Relief Listeners Management
@@ -213,6 +215,6 @@ We had the following then:
7. _message2_ is sent by one of the standard document listeners to another topic within the same message bus during _before change_ processing;
8. the bus tries to deliver all pending messages before queuing _message2_;
9. _subscriber2_ receives _message1_ and also modifies a document;
-10. the call stack is unwinded and _actual change_ phase of document modification operation requested by _subscriber1_ begins;
+10. the call stack is unwound and _actual change_ phase of document modification operation requested by _subscriber1_ begins;
**The problem** is that document range used by _subscriber1_ for initial modification request is invalid if _subscriber2_ has changed document's range before it.
diff --git a/topics/tutorials/file_and_code_templates.md b/topics/tutorials/file_and_code_templates.md
index ac5a8a221..53543fc12 100644
--- a/topics/tutorials/file_and_code_templates.md
+++ b/topics/tutorials/file_and_code_templates.md
@@ -1,6 +1,6 @@
-[//]: # (title: File and Code Templates)
+
-
+# File and Code Templates
File templates allow generating files and code fragments containing repetitive text and patterns.
diff --git a/topics/tutorials/plugin_github_template.md b/topics/tutorials/plugin_github_template.md
index 6dc38d72d..66def456e 100644
--- a/topics/tutorials/plugin_github_template.md
+++ b/topics/tutorials/plugin_github_template.md
@@ -1,12 +1,12 @@
-[//]: # (title: IntelliJ Platform Plugin Template)
+
-
+# IntelliJ Platform Plugin Template
IntelliJ Platform Plugin Template is a GitHub template containing a minimal preconfigured plugin project and GitHub Actions CI workflows that cover building, testing and deploying the plugin.
The IntelliJ Platform Plugin Template is the alternative solution for creating a new Gradle-based IntelliJ Platform plugin with the [New Project Wizard](creating_plugin_project.md).
-[IntelliJ Platform Plugin Template][gh:ippt] is a GitHub repository that provides a pure boilerplate template to make it easier to create a new Gradle-based plugin project.
+[IntelliJ Platform Plugin Template][gh:plugin-template] is a GitHub repository that provides a pure boilerplate template to make it easier to create a new Gradle-based plugin project.
The main goal of this template is to speed up the setup phase of plugin development for both new and experienced developers by preconfiguring the project scaffold and CI, linking to the proper documentation pages, and keeping everything organized.
@@ -16,10 +16,10 @@ After that, the GitHub Actions workflow will be triggered to override or remove
Once this is complete, the project is ready to be cloned to your local environment and opened with [IntelliJ IDEA](https://www.jetbrains.com/idea/download).
-For more details, please refer to the [IntelliJ Platform Plugin Template][gh:ippt] project documentation.
+For more details, please refer to the [IntelliJ Platform Plugin Template][gh:plugin-template] project documentation.
> The recording of the _Busy Plugin Developer. Episode 0_ webinar describes and shows [how to use the IntelliJ Platform Plugin Template](https://youtu.be/-6D5-xEaYig?t=230) in detail.
>
{style="note"}
-[gh:ippt]: https://github.com/JetBrains/intellij-platform-plugin-template
+[gh:plugin-template]: https://github.com/JetBrains/intellij-platform-plugin-template
diff --git a/topics/tutorials/postfix_completion.md b/topics/tutorials/postfix_completion.md
index d81b33d39..c7fe58e77 100644
--- a/topics/tutorials/postfix_completion.md
+++ b/topics/tutorials/postfix_completion.md
@@ -1,6 +1,6 @@
-[//]: # (title: Postfix Completion)
+
-
+# Postfix Completion
Postfix completion allows generating or wrapping existing code into additional constructs without navigating the caret back.
diff --git a/topics/tutorials/postfix_completion/advanced_postfix_templates.md b/topics/tutorials/postfix_completion/advanced_postfix_templates.md
index 5b03fb68d..579bfc8c0 100644
--- a/topics/tutorials/postfix_completion/advanced_postfix_templates.md
+++ b/topics/tutorials/postfix_completion/advanced_postfix_templates.md
@@ -1,6 +1,6 @@
-[//]: # (title: Advanced Postfix Templates)
+
-
+# Advanced Postfix Templates
Advanced postfix templates provide additional features like editing possibilities, expression selector, etc.
@@ -37,7 +37,7 @@ The IntelliJ Platform-based IDEs provide the [Live Templates](https://www.jetbra
It allows defining a template text with dynamic expressions, replaced with actual values depending on the context.
If the implemented postfix template's expanding behavior can be achieved with the live template syntax, it is much easier to extend the
[`StringBasedPostfixTemplate`](%gh-ic%/platform/lang-impl/src/com/intellij/codeInsight/template/postfix/templates/StringBasedPostfixTemplate.java)
-than implementing the expansion behavior programmatically.
+rather than implementing the expansion behavior programmatically.
**Example:** [`StreamPostfixTemplate`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/StreamPostfixTemplate.java) wraps array expression within the `Arrays.stream()` method.