mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
Cleanups
- get rid of the old [//]: # (title: ...) format - reorder copyright notice and title where applicable - fix grammar and other minor issues
This commit is contained in:
parent
09afd90b7c
commit
95aca84917
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Incompatible Changes in IntelliJ Platform and Plugins API)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# Incompatible Changes in IntelliJ Platform and Plugins API
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
=============== DO NOT RENAME OR MOVE THIS FILE ===============
|
=============== DO NOT RENAME OR MOVE THIS FILE ===============
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Notable Changes and Features in IntelliJ Platform and Plugins API)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# Notable Changes and Features in IntelliJ Platform and Plugins API
|
||||||
|
|
||||||
<link-summary>List of Notable API Changes by version</link-summary>
|
<link-summary>List of Notable API Changes by version</link-summary>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Learning Resources)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# Learning Resources
|
||||||
|
|
||||||
<link-summary>Links to articles and webinars about plugin development.</link-summary>
|
<link-summary>Links to articles and webinars about plugin development.</link-summary>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Gradle IntelliJ Plugin – Usage Examples)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# Gradle IntelliJ Plugin – Usage Examples
|
||||||
|
|
||||||
<link-summary>Usage Examples of plugins using Gradle IntelliJ Plugin.</link-summary>
|
<link-summary>Usage Examples of plugins using Gradle IntelliJ Plugin.</link-summary>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[//]: # (title: Bundling Plugin API Sources)
|
|
||||||
|
|
||||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# Bundling Plugin API Sources
|
||||||
|
|
||||||
<link-summary>Exposing plugin's API sources for other plugins.</link-summary>
|
<link-summary>Exposing plugin's API sources for other plugins.</link-summary>
|
||||||
|
|
||||||
If a plugin exposes its own API that is meant to be used by other plugins, it is worth considering bundling the plugin's API sources in the ZIP distribution.
|
If a plugin exposes its own API that is meant to be used by other plugins, it is worth considering bundling the plugin's API sources in the ZIP distribution.
|
||||||
@ -13,7 +13,7 @@ Being able to see API sources drastically improves the development experience, a
|
|||||||
>
|
>
|
||||||
{style="note"}
|
{style="note"}
|
||||||
|
|
||||||
## API sources location
|
## API Sources Location
|
||||||
|
|
||||||
The API source JARs must be located in the <path>example-plugin.zip!/plugin/lib/src</path> directory in the plugin ZIP distribution, e.g.:
|
The API source JARs must be located in the <path>example-plugin.zip!/plugin/lib/src</path> directory in the plugin ZIP distribution, e.g.:
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[//]: # (title: Disposer and Disposable)
|
|
||||||
|
|
||||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# Disposer and Disposable
|
||||||
|
|
||||||
<link-summary>Cleaning up resources on plugin components' lifetime expiration.</link-summary>
|
<link-summary>Cleaning up resources on plugin components' lifetime expiration.</link-summary>
|
||||||
|
|
||||||
The IntelliJ Platform's [`Disposer`](%gh-ic%/platform/util/src/com/intellij/openapi/util/Disposer.java) facilitates resource cleanup.
|
The IntelliJ Platform's [`Disposer`](%gh-ic%/platform/util/src/com/intellij/openapi/util/Disposer.java) facilitates resource cleanup.
|
||||||
@ -21,7 +21,7 @@ The `Disposer` supports chaining `Disposables` in parent-child relationships.
|
|||||||
Many objects are disposed automatically by the platform if they implement the `Disposable` interface.
|
Many objects are disposed automatically by the platform if they implement the `Disposable` interface.
|
||||||
The most important type of such objects is [services](plugin_services.md).
|
The most important type of such objects is [services](plugin_services.md).
|
||||||
Application-level services are automatically disposed by the platform when the IDE is closed or the plugin providing the service is unloaded.
|
Application-level services are automatically disposed by the platform when the IDE is closed or the plugin providing the service is unloaded.
|
||||||
Project-level services are disposed when the project is closed, or the plugin is unloaded.
|
Project-level services are disposed on project close or plugin unload events.
|
||||||
|
|
||||||
Note that extensions registered in <path>[plugin.xml](plugin_configuration_file.md)</path> are *not* automatically disposed.
|
Note that extensions registered in <path>[plugin.xml](plugin_configuration_file.md)</path> are *not* automatically disposed.
|
||||||
If an extension requires executing some code to dispose it, you need to define a service and to put the code in its `dispose()` method or use it as a parent disposable.
|
If an extension requires executing some code to dispose it, you need to define a service and to put the code in its `dispose()` method or use it as a parent disposable.
|
||||||
@ -114,8 +114,13 @@ An example of a non-trivial `dispose` implementation is shown below:
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
public class Foo<T> extends JBFoo implements Disposable {
|
public class Foo<T> extends JBFoo implements Disposable {
|
||||||
public Foo(@NotNull Project project, @NotNull String name, @Nullable FileEditor fileEditor, @NotNull Disposable parentDisposable) {
|
|
||||||
this(project, name, fileEditor, InitParams.createParams(project), DetachedToolWindowManager.getInstance(project));
|
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);
|
Disposer.register(parentDisposable, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +128,8 @@ An example of a non-trivial `dispose` implementation is shown below:
|
|||||||
public void dispose() {
|
public void dispose() {
|
||||||
myFooManager.unregister(this);
|
myFooManager.unregister(this);
|
||||||
myDetachedToolWindowManager.unregister(myFileEditor);
|
myDetachedToolWindowManager.unregister(myFileEditor);
|
||||||
KeyboardFocusManager.getCurrentKeyboardFocusManager().removePropertyChangeListener("focusOwner", myMyPropertyChangeListener);
|
KeyboardFocusManager.getCurrentKeyboardFocusManager()
|
||||||
|
.removePropertyChangeListener("focusOwner", myMyPropertyChangeListener);
|
||||||
setToolContext(null);
|
setToolContext(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Creating a Theme Project)
|
<!-- Copyright 2000-2023 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. -->
|
# Creating a Theme Project
|
||||||
|
|
||||||
<link-summary>Creating a theme plugin project with Plugin DevKit wizard and generated project overview.</link-summary>
|
<link-summary>Creating a theme plugin project with Plugin DevKit wizard and generated project overview.</link-summary>
|
||||||
|
|
||||||
@ -38,7 +38,8 @@ my_theme
|
|||||||
|
|
||||||
- <path>META-INF</path> directory with:
|
- <path>META-INF</path> directory with:
|
||||||
- <path>[plugin.xml](plugin_configuration_file.md)</path> configuration file containing preconfigured theme provider
|
- <path>[plugin.xml](plugin_configuration_file.md)</path> configuration file containing preconfigured theme provider
|
||||||
- <path>pluginIcon.svg</path> file that is a [plugin logo](plugin_icon_file.md)<br/>
|
- <path>pluginIcon.svg</path> file that is a [plugin logo](plugin_icon_file.md)
|
||||||
|
|
||||||
It is recommended to replace it with a custom icon.
|
It is recommended to replace it with a custom icon.
|
||||||
- <path>my_theme.theme.json</path> - a minimal [theme description file](themes_customize.md#introduction-to-theme-description-file-syntax)
|
- <path>my_theme.theme.json</path> - a minimal [theme description file](themes_customize.md#introduction-to-theme-description-file-syntax)
|
||||||
- <path>my_theme.iml</path> - [IntelliJ IDEA Module](https://www.jetbrains.com/help/idea/creating-and-managing-modules.html) configuration file
|
- <path>my_theme.iml</path> - [IntelliJ IDEA Module](https://www.jetbrains.com/help/idea/creating-and-managing-modules.html) configuration file
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Developing a Theme)
|
<!-- Copyright 2000-2023 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. -->
|
# Developing a Theme
|
||||||
|
|
||||||
<link-summary>Develop an IntelliJ Platform-based IDE theme using Plugin DevKit.</link-summary>
|
<link-summary>Develop an IntelliJ Platform-based IDE theme using Plugin DevKit.</link-summary>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Running and Debugging a Theme)
|
<!-- Copyright 2000-2023 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. -->
|
# Running and Debugging a Theme
|
||||||
|
|
||||||
<link-summary>Running and debugging a theme in the actual IDE instance.</link-summary>
|
<link-summary>Running and debugging a theme in the actual IDE instance.</link-summary>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Setting Up a Development Environment)
|
<!-- Copyright 2000-2023 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. -->
|
# Setting Up a Development Environment
|
||||||
|
|
||||||
<link-summary>Setting up a development environment required for developing a theme.</link-summary>
|
<link-summary>Setting up a development environment required for developing a theme.</link-summary>
|
||||||
|
|
||||||
@ -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.
|
> 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).
|
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_.
|
In most cases, it is enough to download and use _[IntelliJ IDEA](https://www.jetbrains.com/idea/download/) Community Edition_.
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
[//]: # (title: Customizing Themes - Icons and UI Controls)
|
<!-- Copyright 2000-2023 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. -->
|
# Customizing Themes - Icons and UI Controls
|
||||||
|
|
||||||
|
<link-summary>Customizing UI controls and icons in a theme plugin.</link-summary>
|
||||||
|
|
||||||
<tldr>
|
<tldr>
|
||||||
|
|
||||||
@ -8,8 +10,6 @@
|
|||||||
|
|
||||||
</tldr>
|
</tldr>
|
||||||
|
|
||||||
<link-summary>Customizing UI controls and icons in a theme plugin.</link-summary>
|
|
||||||
|
|
||||||
A theme is customized by adding information to the theme description file that overrides the base (_Light_ or _Darcula_) theme.
|
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.
|
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.
|
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.
|
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.
|
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).
|
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.
|
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:
|
The `value` is the replacement icon's file name, located in the `resources` folder of the theme plugin project:
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Getting Started)
|
<!-- Copyright 2000-2023 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. -->
|
# Getting Started
|
||||||
|
|
||||||
<link-summary>Customizing IDE UI by developing a custom theme.</link-summary>
|
<link-summary>Customizing IDE UI by developing a custom theme.</link-summary>
|
||||||
|
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
[//]: # (title: Plugin Configuration File)
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# Plugin Configuration File
|
||||||
|
|
||||||
<show-structure for="chapter" depth="4"/>
|
<show-structure for="chapter" depth="4"/>
|
||||||
|
|
||||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
|
||||||
|
|
||||||
<link-summary>Plugin configuration file contains all the information about the plugin, as well as all registered extensions, actions, listeners, etc.</link-summary>
|
<link-summary>Plugin configuration file contains all the information about the plugin, as well as all registered extensions, actions, listeners, etc.</link-summary>
|
||||||
|
|
||||||
The <path>plugin.xml</path> 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.
|
The <path>plugin.xml</path> 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.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Listeners)
|
<!-- Copyright 2000-2023 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. -->
|
# Listeners
|
||||||
|
|
||||||
<link-summary>Listeners allow subscription to application and project events.</link-summary>
|
<link-summary>Listeners allow subscription to application and project events.</link-summary>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: PSI Cookbook)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# PSI Cookbook
|
||||||
|
|
||||||
<link-summary rel="excerpt"/>
|
<link-summary rel="excerpt"/>
|
||||||
<p id="excerpt">
|
<p id="excerpt">
|
||||||
@ -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).
|
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
|
## General
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[//]: # (title: Test Project and Testdata Directories)
|
|
||||||
|
|
||||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# Test Project and Testdata Directories
|
||||||
|
|
||||||
<link-summary>Adding test data to test projects used during tests execution.</link-summary>
|
<link-summary>Adding test data to test projects used during tests execution.</link-summary>
|
||||||
|
|
||||||
The test fixture creates a *test project* environment.
|
The test fixture creates a *test project* environment.
|
||||||
@ -48,6 +48,7 @@ These methods copy the specified files from the <path>testdata</path> directory
|
|||||||
>
|
>
|
||||||
|
|
||||||
### Special Markup
|
### 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.
|
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:
|
You can use one of the following markers:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Spring API)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# Spring API
|
||||||
|
|
||||||
<link-summary rel="excerpt"/>
|
<link-summary rel="excerpt"/>
|
||||||
<p id="excerpt">
|
<p id="excerpt">
|
||||||
@ -103,7 +103,7 @@ _Version 14_: `com.intellij.spring.model.utils.SpringModelSearchers#findBeans`
|
|||||||
|
|
||||||
_Version 16_: note deprecation of `SpringModelSearchParameters.BeanClass#withInheritors(GlobalSearchScope)`
|
_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)
|
_Version 14_: `com.intellij.spring.model.utils.SpringModelSearchers#doesBeanExist` (please note deprecated methods)
|
||||||
|
|
||||||
#### Mark Bean as Infrastructure Bean
|
#### Mark Bean as Infrastructure Bean
|
||||||
@ -171,7 +171,7 @@ Spring Boot API allows extending/accessing Spring Boot specific support in the I
|
|||||||
>
|
>
|
||||||
{style="warning"}
|
{style="warning"}
|
||||||
|
|
||||||
### Setting up
|
### Setting Up
|
||||||
[Add dependency](plugin_dependencies.md) to bundled Spring Boot plugin with ID `com.intellij.spring.boot`.
|
[Add dependency](plugin_dependencies.md) to bundled Spring Boot plugin with ID `com.intellij.spring.boot`.
|
||||||
Sources for Spring Boot API are available in <path>$IDEA_HOME$/lib/src/src_spring-boot-openapi.zip</path>.
|
Sources for Spring Boot API are available in <path>$IDEA_HOME$/lib/src/src_spring-boot-openapi.zip</path>.
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Custom Language Support)
|
<!-- Copyright 2000-2023 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. -->
|
# Custom Language Support
|
||||||
|
|
||||||
<link-summary>Supporting custom languages overview.</link-summary>
|
<link-summary>Supporting custom languages overview.</link-summary>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[//]: # (title: Code Inspections and Intentions)
|
|
||||||
|
|
||||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# Code Inspections and Intentions
|
||||||
|
|
||||||
<link-summary>Introduction to analysing the code and providing quick fixes for the found issues.</link-summary>
|
<link-summary>Introduction to analysing the code and providing quick fixes for the found issues.</link-summary>
|
||||||
|
|
||||||
<tldr>
|
<tldr>
|
||||||
|
@ -1,10 +1,8 @@
|
|||||||
[//]: # (title: Implementing Lexer)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# Implementing Lexer
|
||||||
|
|
||||||
<link-summary>
|
<link-summary>A Lexer defines how a file's contents are broken into tokens.</link-summary>
|
||||||
A Lexer defines how a file's contents are broken into tokens.
|
|
||||||
</link-summary>
|
|
||||||
|
|
||||||
The lexer, or [lexical analyzer](https://en.wikipedia.org/wiki/Lexical_analysis), 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.
|
The lexer serves as a foundation for nearly all features of custom language plugins, from basic syntax highlighting to advanced code analysis features.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Symbols)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# Symbols
|
||||||
|
|
||||||
> This API is available starting from 2020.3 and is currently in development and thus in an experimental state.
|
> This API is available starting from 2020.3 and is currently in development and thus in an experimental state.
|
||||||
>
|
>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[//]: # (title: IntelliJ Platform Artifacts Repositories)
|
|
||||||
|
|
||||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# IntelliJ Platform Artifacts Repositories
|
||||||
|
|
||||||
<link-summary>Overview of the repositories hosting artifacts related to the IntelliJ Platform.</link-summary>
|
<link-summary>Overview of the repositories hosting artifacts related to the IntelliJ Platform.</link-summary>
|
||||||
|
|
||||||
> When using additional repositories, make sure to use HTTPS always.
|
> 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 |
|
| 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:
|
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:
|
* Snapshot versions are specified as:
|
||||||
* The snapshot of the most recent branch build is specified as _BRANCH-EAP-SNAPSHOT_. For example, `193-EAP-SNAPSHOT`.
|
* 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.
|
There is only one of this type of build for each branch of each product.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
[//]: # (title: Messaging Infrastructure)
|
|
||||||
|
|
||||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
<!-- Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||||
|
|
||||||
|
# Messaging Infrastructure
|
||||||
|
|
||||||
<link-summary>Subscribing and publishing messages via message bus.</link-summary>
|
<link-summary>Subscribing and publishing messages via message bus.</link-summary>
|
||||||
|
|
||||||
## Purpose
|
## 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.
|
* 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;
|
Connection will use that *default handler* when storing *(topic-handler)* mapping;
|
||||||
* it's possible to explicitly release acquired resources (*disconnect()* method).
|
* 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
|
### Putting Altogether
|
||||||
|
|
||||||
@ -63,7 +63,8 @@ Manages all subscriptions for particular client within particular bus.
|
|||||||
```java
|
```java
|
||||||
public interface ChangeActionNotifier {
|
public interface ChangeActionNotifier {
|
||||||
|
|
||||||
Topic<ChangeActionNotifier> CHANGE_ACTION_TOPIC = Topic.create("custom name", ChangeActionNotifier.class);
|
Topic<ChangeActionNotifier> CHANGE_ACTION_TOPIC =
|
||||||
|
Topic.create("custom name", ChangeActionNotifier.class);
|
||||||
|
|
||||||
void beforeAction(Context context);
|
void beforeAction(Context context);
|
||||||
void afterAction(Context context);
|
void afterAction(Context context);
|
||||||
@ -80,7 +81,8 @@ public interface ChangeActionNotifier {
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
public void init(MessageBus bus) {
|
public void init(MessageBus bus) {
|
||||||
bus.connect().subscribe(ActionTopics.CHANGE_ACTION_TOPIC, new ChangeActionNotifier() {
|
bus.connect().subscribe(ActionTopics.CHANGE_ACTION_TOPIC,
|
||||||
|
new ChangeActionNotifier() {
|
||||||
@Override
|
@Override
|
||||||
public void beforeAction(Context context) {
|
public void beforeAction(Context context) {
|
||||||
// Process 'before action' event.
|
// Process 'before action' event.
|
||||||
@ -99,13 +101,13 @@ public void init(MessageBus bus) {
|
|||||||
|
|
||||||
```java
|
```java
|
||||||
public void doChange(Context context) {
|
public void doChange(Context context) {
|
||||||
ChangeActionNotifier publisher = myBus.syncPublisher(ActionTopics.CHANGE_ACTION_TOPIC);
|
ChangeActionNotifier publisher =
|
||||||
|
myBus.syncPublisher(ActionTopics.CHANGE_ACTION_TOPIC);
|
||||||
publisher.beforeAction(context);
|
publisher.beforeAction(context);
|
||||||
try {
|
try {
|
||||||
// Do action
|
// do action
|
||||||
// ...
|
|
||||||
} finally {
|
} finally {
|
||||||
publisher.afterAction(context)
|
publisher.afterAction(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -173,7 +175,7 @@ Let's see what happens if someone sends a message to the target topic:
|
|||||||
* _handler2_ receives _message2_;
|
* _handler2_ receives _message2_;
|
||||||
* _handler1_ receives _message2_;
|
* _handler1_ receives _message2_;
|
||||||
|
|
||||||
## Tips'n'tricks
|
## Tips and Tricks
|
||||||
|
|
||||||
### Relief Listeners Management
|
### 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;
|
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_;
|
8. the bus tries to deliver all pending messages before queuing _message2_;
|
||||||
9. _subscriber2_ receives _message1_ and also modifies a document;
|
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.
|
**The problem** is that document range used by _subscriber1_ for initial modification request is invalid if _subscriber2_ has changed document's range before it.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: File and Code Templates)
|
<!-- Copyright 2000-2023 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 other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
# File and Code Templates
|
||||||
|
|
||||||
<link-summary>File templates allow generating files and code fragments containing repetitive text and patterns.</link-summary>
|
<link-summary>File templates allow generating files and code fragments containing repetitive text and patterns.</link-summary>
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
[//]: # (title: IntelliJ Platform Plugin Template)
|
<!-- Copyright 2000-2023 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. -->
|
# IntelliJ Platform Plugin Template
|
||||||
|
|
||||||
<link-summary>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.</link-summary>
|
<link-summary>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.</link-summary>
|
||||||
|
|
||||||
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).
|
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.
|
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).
|
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.
|
> 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"}
|
{style="note"}
|
||||||
|
|
||||||
[gh:ippt]: https://github.com/JetBrains/intellij-platform-plugin-template
|
[gh:plugin-template]: https://github.com/JetBrains/intellij-platform-plugin-template
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Postfix Completion)
|
<!-- Copyright 2000-2023 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. -->
|
# Postfix Completion
|
||||||
|
|
||||||
<link-summary>Postfix completion allows generating or wrapping existing code into additional constructs without navigating the caret back.</link-summary>
|
<link-summary>Postfix completion allows generating or wrapping existing code into additional constructs without navigating the caret back.</link-summary>
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[//]: # (title: Advanced Postfix Templates)
|
<!-- Copyright 2000-2023 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. -->
|
# Advanced Postfix Templates
|
||||||
|
|
||||||
<link-summary>Advanced postfix templates provide additional features like editing possibilities, expression selector, etc.</link-summary>
|
<link-summary>Advanced postfix templates provide additional features like editing possibilities, expression selector, etc.</link-summary>
|
||||||
|
|
||||||
@ -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.
|
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
|
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)
|
[`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.
|
**Example:** [`StreamPostfixTemplate`](%gh-ic%/java/java-impl/src/com/intellij/codeInsight/template/postfix/templates/StreamPostfixTemplate.java) wraps array expression within the `Arrays.stream()` method.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user