mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
markdown: cleanup, formatting
This commit is contained in:
parent
baba1ffb1e
commit
256dff07e6
@ -351,8 +351,8 @@ Java code migrated to use `TYPE_USE` nullability annotations
|
|||||||
|
|
||||||
Images module functionality (package `org.intellij.images.*`) extracted to plugin
|
Images module functionality (package `org.intellij.images.*`) extracted to plugin
|
||||||
: The dependency [must be declared](plugin_dependencies.md) explicitly now:
|
: The dependency [must be declared](plugin_dependencies.md) explicitly now:
|
||||||
* Add `<depends>com.intellij.platform.images</depends>` in `plugin.xml`
|
* Add `<depends>com.intellij.platform.images</depends>` in <path>plugin.xml</path>
|
||||||
* Add to `build.gradle`:
|
* Add to <path>build.gradle</path>:
|
||||||
|
|
||||||
```groovy
|
```groovy
|
||||||
intellij {
|
intellij {
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
: Now reflects its "heavy test" characteristics (see [Light and Heavy Tests](light_and_heavy_tests.md)).
|
: Now reflects its "heavy test" characteristics (see [Light and Heavy Tests](light_and_heavy_tests.md)).
|
||||||
|
|
||||||
Support for transitive optional plugin dependencies
|
Support for transitive optional plugin dependencies
|
||||||
: Optional `plugin.xml` configuration files can now specify `<depends>`. [Issue](https://youtrack.jetbrains.com/issue/IDEA-209769)
|
: Optional <path>plugin.xml</path> configuration files can now specify `<depends>`. [Issue](https://youtrack.jetbrains.com/issue/IDEA-209769)
|
||||||
|
|
||||||
Theme/Keymap plugins do not require restart
|
Theme/Keymap plugins do not require restart
|
||||||
: (Un)Installing or enabling/disabling [Theme](themes_intro.md) or [Keymap](https://plugins.jetbrains.com/search?tags=Keymap) plugins doesn't require an IDE restart anymore.
|
: (Un)Installing or enabling/disabling [Theme](themes_intro.md) or [Keymap](https://plugins.jetbrains.com/search?tags=Keymap) plugins doesn't require an IDE restart anymore.
|
||||||
|
@ -124,7 +124,7 @@ JCEF Support (_Experimental Feature_)
|
|||||||
: Allows [embedding](jcef.md) Chromium-based browser in the IDE.
|
: Allows [embedding](jcef.md) Chromium-based browser in the IDE.
|
||||||
|
|
||||||
Override text presentation for actions depending on menu context
|
Override text presentation for actions depending on menu context
|
||||||
: Set the [`<override-text>`](basic_action_system.md#setting-the-override-text-element) element within the `<action>` declaration in `plugin.xml`.
|
: Set the [`<override-text>`](basic_action_system.md#setting-the-override-text-element) element within the `<action>` declaration in <path>plugin.xml</path>.
|
||||||
|
|
||||||
Changes in Project Open/Import
|
Changes in Project Open/Import
|
||||||
: **Import from Existing Sources** has been removed from the Welcome Screen, leaving only **Open or Import**, which calls a different extension than the one previously used to contribute a wizard step to **Import from Existing Sources** (which is still available in the **File** menu). To support **Open or Import**, a plugin must provide [`ProjectOpenProcessor`](upsource:///platform/platform-api/src/com/intellij/projectImport/ProjectOpenProcessor.java).
|
: **Import from Existing Sources** has been removed from the Welcome Screen, leaving only **Open or Import**, which calls a different extension than the one previously used to contribute a wizard step to **Import from Existing Sources** (which is still available in the **File** menu). To support **Open or Import**, a plugin must provide [`ProjectOpenProcessor`](upsource:///platform/platform-api/src/com/intellij/projectImport/ProjectOpenProcessor.java).
|
||||||
|
@ -21,7 +21,7 @@ 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 when the project is closed, or the plugin is unloaded.
|
||||||
|
|
||||||
Note that extensions registered in `plugin.xml` are *not* automatically disposed.
|
Note that extensions registered in <path>plugin.xml</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.
|
||||||
|
|
||||||
## The Disposer Singleton
|
## The Disposer Singleton
|
||||||
@ -181,4 +181,4 @@ In turn, that code allocated a `Project` that was never disposed by the time the
|
|||||||
That is a promising place to start digging.
|
That is a promising place to start digging.
|
||||||
|
|
||||||
The above memory leak was ultimately caused by failing to pass a `Project` instance to a function responsible for registering it for disposal.
|
The above memory leak was ultimately caused by failing to pass a `Project` instance to a function responsible for registering it for disposal.
|
||||||
Often the fix for a memory leak is as simple as understanding the memory scope of the object being allocated - usually a UI container, project, or application - and making sure a `Disposer.register()` call is made appropriately for it.
|
Often the fix for a memory leak is as simple as understanding the memory scope of the object being allocated - usually a UI container, project, or application - and making sure a `Disposer.register()` call is made appropriately for it.
|
||||||
|
@ -150,7 +150,7 @@ The simplest ways of specifying the `@Storage` annotation are as follows (since
|
|||||||
|
|
||||||
The state is persisted in a separate file by specifying a different setting for the `value` parameter, which was the `file` parameter before 2016.x.
|
The state is persisted in a separate file by specifying a different setting for the `value` parameter, which was the `file` parameter before 2016.x.
|
||||||
|
|
||||||
> For application-level components, it is strongly recommended to use a custom file, using of `other.xml` is deprecated.
|
> For application-level components, it is strongly recommended to use a custom file, using of <path>other.xml</path> is deprecated.
|
||||||
>
|
>
|
||||||
{type="note"}
|
{type="note"}
|
||||||
|
|
||||||
@ -194,6 +194,6 @@ Implementations can manually store the state in attributes and sub-elements or u
|
|||||||
|
|
||||||
Components save their state in the following files:
|
Components save their state in the following files:
|
||||||
|
|
||||||
* Project-level: project (`.ipr`) file.
|
* Project-level: project (<path>.ipr</path>) file.
|
||||||
However, if the workspace option in the `plugin.xml` file is set to `true`, then the workspace (`.iws`) file is used instead.
|
However, if the workspace option in the <path>plugin.xml</path> file is set to `true`, then the workspace (<path>.iws</path>) file is used instead.
|
||||||
* Module-level: module (`.iml`) file.
|
* Module-level: module (<path>.iml</path>) file.
|
||||||
|
@ -16,7 +16,7 @@ To express dependencies on classes from other plugins or modules, perform the fo
|
|||||||
|
|
||||||
1. Locate Plugin ID
|
1. Locate Plugin ID
|
||||||
2. Project Setup
|
2. Project Setup
|
||||||
3. Declaration in `plugin.xml`
|
3. Declaration in <path>plugin.xml</path>
|
||||||
|
|
||||||
If `NoClassDefFoundError` occurs at runtime, it means that either Step 3 was omitted or loading the plugin dependency failed (please check log files from [Development Instance](ide_development_instance.md#development-instance-settings-caches-logs-and-plugins)).
|
If `NoClassDefFoundError` occurs at runtime, it means that either Step 3 was omitted or loading the plugin dependency failed (please check log files from [Development Instance](ide_development_instance.md#development-instance-settings-caches-logs-and-plugins)).
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ This is useful e.g. when a plugin brings its own file templates.
|
|||||||
For the ReSharper part to pick these settings, the settings files should be available in the plugin JAR file under the path <path>dotnet/Extensions/$backend-plugin-id$/settings</path>, where `backend-plugin-id` is calculated according to the following rules:
|
For the ReSharper part to pick these settings, the settings files should be available in the plugin JAR file under the path <path>dotnet/Extensions/$backend-plugin-id$/settings</path>, where `backend-plugin-id` is calculated according to the following rules:
|
||||||
|
|
||||||
- if the IntelliJ plugin id (the `<id>` element of the <path>plugin.xml</path>) includes a dot, then `backend-plugin-id` is the same as the IntelliJ plugin id;
|
- if the IntelliJ plugin id (the `<id>` element of the <path>plugin.xml</path>) includes a dot, then `backend-plugin-id` is the same as the IntelliJ plugin id;
|
||||||
- otherwise, the `backend-plugin-id` is a concatenation of the IntelliJ plugin vendor name (the `<vendor>` element of the `plugin.xml`) and the IntelliJ plugin id.
|
- otherwise, the `backend-plugin-id` is a concatenation of the IntelliJ plugin vendor name (the `<vendor>` element of the <path>plugin.xml</path>) and the IntelliJ plugin id.
|
||||||
|
|
||||||
For example, for a plugin with the following <path>plugin.xml</path> contents, the file `dotnet/Extensions/org.awesomeplugin/settings/templates.DotSettings` would be picked up:
|
For example, for a plugin with the following <path>plugin.xml</path> contents, the file `dotnet/Extensions/org.awesomeplugin/settings/templates.DotSettings` would be picked up:
|
||||||
|
|
||||||
@ -73,4 +73,4 @@ This list is intended to provide some representative projects.
|
|||||||
* [TestLinker](https://github.com/matkoch/TestLinker/)
|
* [TestLinker](https://github.com/matkoch/TestLinker/)
|
||||||
* [Xao](https://github.com/hmemcpy/ReSharper.Xao/)
|
* [Xao](https://github.com/hmemcpy/ReSharper.Xao/)
|
||||||
* [Azure Toolkit for Rider](https://github.com/JetBrains/azure-tools-for-intellij)
|
* [Azure Toolkit for Rider](https://github.com/JetBrains/azure-tools-for-intellij)
|
||||||
* [T4 language support for both ReSharper and Rider](https://github.com/JetBrains/ForTea)
|
* [T4 language support for both ReSharper and Rider](https://github.com/JetBrains/ForTea)
|
||||||
|
@ -32,7 +32,7 @@ Product compatibility is determined from the Ruby plugin [version page](https://
|
|||||||
The Ruby plugin isn't bundled with `IU`, so the Ruby plugin version must be explicitly declared to support the target RubyMine (and `IU`) BRANCH.BUILD version.
|
The Ruby plugin isn't bundled with `IU`, so the Ruby plugin version must be explicitly declared to support the target RubyMine (and `IU`) BRANCH.BUILD version.
|
||||||
The correct Ruby plugin version is also determined from the Ruby plugin version page.
|
The correct Ruby plugin version is also determined from the Ruby plugin version page.
|
||||||
|
|
||||||
The dependency on the Ruby plugin APIs must be declared in the `plugin.xml` file.
|
The dependency on the Ruby plugin APIs must be declared in the <path>plugin.xml</path> file.
|
||||||
As described in [Modules Specific to Functionality](plugin_compatibility.md#modules-specific-to-functionality) table, the `<depends>` elements must contain `com.intellij.modules.ruby`.
|
As described in [Modules Specific to Functionality](plugin_compatibility.md#modules-specific-to-functionality) table, the `<depends>` elements must contain `com.intellij.modules.ruby`.
|
||||||
The dependency declaration is illustrated in the <path>plugin.xml</path> snippet below:
|
The dependency declaration is illustrated in the <path>plugin.xml</path> snippet below:
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
A number of minor features are listed in the following format:
|
A number of minor features are listed in the following format:
|
||||||
|
|
||||||
_EP: `fully.qualified.extensionPointName`_ - Extension Point Name (must be specified in `plugin.xml`)
|
_EP: `fully.qualified.extensionPointName`_ - Extension Point Name (must be specified in <path>plugin.xml</path>)
|
||||||
|
|
||||||
_`com.extensionPoint.class`_ _description text_ - Extension Point class/interface to provide functionality
|
_`com.extensionPoint.class`_ _description text_ - Extension Point class/interface to provide functionality
|
||||||
|
|
||||||
@ -90,4 +90,4 @@ EP: `com.intellij.colorProvider`
|
|||||||
### File Includes
|
### File Includes
|
||||||
EP: `com.intellij.include.provider`
|
EP: `com.intellij.include.provider`
|
||||||
|
|
||||||
[`FileIncludeProvider`](upsource:///platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeProvider.java) provides information about _include_ statements resolving to files (e.g., `<xi:include>` in XML). Including/included files can then be obtained via [`FileIncludeManager`](upsource:///platform/lang-api/src/com/intellij/psi/impl/include/FileIncludeManager.java).
|
[`FileIncludeProvider`](upsource:///platform/lang-impl/src/com/intellij/psi/impl/include/FileIncludeProvider.java) provides information about _include_ statements resolving to files (e.g., `<xi:include>` in XML). Including/included files can then be obtained via [`FileIncludeManager`](upsource:///platform/lang-api/src/com/intellij/psi/impl/include/FileIncludeManager.java).
|
||||||
|
@ -49,7 +49,7 @@ That means that a set of *DataNode*, *Key* and *ProjectDataServices* can be intr
|
|||||||
IntelliJ platform provides standard API for that.
|
IntelliJ platform provides standard API for that.
|
||||||
Namely, [`ProjectImportBuilder`](upsource:///java/idea-ui/src/com/intellij/projectImport/ProjectImportBuilder.java) and [`ProjectImportProvider`](upsource:///java/idea-ui/src/com/intellij/projectImport/ProjectImportProvider.java).
|
Namely, [`ProjectImportBuilder`](upsource:///java/idea-ui/src/com/intellij/projectImport/ProjectImportBuilder.java) and [`ProjectImportProvider`](upsource:///java/idea-ui/src/com/intellij/projectImport/ProjectImportProvider.java).
|
||||||
There are two classes built on *template method* pattern - [`AbstractExternalProjectImportBuilder`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportBuilder.java) and [`AbstractExternalProjectImportProvider`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportProvider.java).
|
There are two classes built on *template method* pattern - [`AbstractExternalProjectImportBuilder`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportBuilder.java) and [`AbstractExternalProjectImportProvider`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/project/wizard/AbstractExternalProjectImportProvider.java).
|
||||||
Concrete implementations are registered in `plugin.xml`.
|
Concrete implementations are registered in <path>plugin.xml</path>.
|
||||||
|
|
||||||
Here is an example from the gradle integration plugin:
|
Here is an example from the gradle integration plugin:
|
||||||
|
|
||||||
@ -103,4 +103,4 @@ It's recommended to extend from [`AbstractExternalProjectSettingsControl`](upsou
|
|||||||
|
|
||||||
Similar approach is used for providing 'import from external system' UI - implementation is expected to extend [`AbstractImportFromExternalSystemControl`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/settings/AbstractImportFromExternalSystemControl.java) and it has not linked external projects list but target external project path control:
|
Similar approach is used for providing 'import from external system' UI - implementation is expected to extend [`AbstractImportFromExternalSystemControl`](upsource:///java/idea-ui/src/com/intellij/openapi/externalSystem/service/settings/AbstractImportFromExternalSystemControl.java) and it has not linked external projects list but target external project path control:
|
||||||
|
|
||||||

|

|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
EP: `com.intellij.extendWordSelectionHandler`
|
EP: `com.intellij.extendWordSelectionHandler`
|
||||||
|
|
||||||
Implementing [`ExtendWordSelectionHandler`](upsource:///platform/lang-api/src/com/intellij/codeInsight/editorActions/ExtendWordSelectionHandler.java) and registering it as `com.intellij.extendWordSelectionHandler` EP in your `plugin.xml` allows you to provide additional text ranges to be used when extending or shrinking a selection.
|
Implementing [`ExtendWordSelectionHandler`](upsource:///platform/lang-api/src/com/intellij/codeInsight/editorActions/ExtendWordSelectionHandler.java) and registering it as `com.intellij.extendWordSelectionHandler` EP in your <path>plugin.xml</path> allows you to provide additional text ranges to be used when extending or shrinking a selection.
|
||||||
Return `true` from `canSelect(PsiElement)` for the PSI elements that you want to provide additional text-ranges for.
|
Return `true` from `canSelect(PsiElement)` for the PSI elements that you want to provide additional text-ranges for.
|
||||||
The IntelliJ Platform will call `select(PsiElement, CharSequence, int, Editor)` for these elements where you can compute additional text ranges and return them as `List<TextRange>`.
|
The IntelliJ Platform will call `select(PsiElement, CharSequence, int, Editor)` for these elements where you can compute additional text ranges and return them as `List<TextRange>`.
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ This makes it easy to select not only expressions, blocks, and function definiti
|
|||||||
|
|
||||||
When implementing a custom language, the IntelliJ Platform provides basic implementations of this EP, allowing you to select code based on your PSI structure and to select whole lines.
|
When implementing a custom language, the IntelliJ Platform provides basic implementations of this EP, allowing you to select code based on your PSI structure and to select whole lines.
|
||||||
In many cases this is sufficient to provide a good user experience.
|
In many cases this is sufficient to provide a good user experience.
|
||||||
However, sometimes it’s advantageous to provide additional regions that the user may wish to be able to select when extending or shrinking a selection.
|
However, sometimes it’s advantageous to provide additional regions that the user may wish to be able to select when extending or shrinking a selection.
|
||||||
|
|
||||||
This EP has two methods that need to be implemented:
|
This EP has two methods that need to be implemented:
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ If the cursor is located at argument `a`, extending the selection would first se
|
|||||||
However, you might want to select the list of all arguments as an intermediate step.
|
However, you might want to select the list of all arguments as an intermediate step.
|
||||||
This can be achieved by implementing this EP in the following way:
|
This can be achieved by implementing this EP in the following way:
|
||||||
|
|
||||||
1. Create a class that implements the `ExtendWordSelectionHandler` interface and register it as a `com.intellij.extendWordSelectionHandler` EP in your `plugin.xml`.
|
1. Create a class that implements the `ExtendWordSelectionHandler` interface and register it as a `com.intellij.extendWordSelectionHandler` EP in your <path>plugin.xml</path>.
|
||||||
2. The `canSelect(PsiElement)` method should return `true` for the function call node.
|
2. The `canSelect(PsiElement)` method should return `true` for the function call node.
|
||||||
That indicates that `select(PsiElement, CharSequence, int, Editor)` will be called for the function-call node.
|
That indicates that `select(PsiElement, CharSequence, int, Editor)` will be called for the function-call node.
|
||||||
3. When the `select()` method is called, you can use the function call PSI element or the editor text to extract the text range that spans the arguments `a` and `b` and return it as `List<TextRange>` with one element.
|
3. When the `select()` method is called, you can use the function call PSI element or the editor text to extract the text range that spans the arguments `a` and `b` and return it as `List<TextRange>` with one element.
|
||||||
|
@ -13,7 +13,7 @@ In this first example, the action group will be available as a top-level menu it
|
|||||||
The group is based on a default IntelliJ Platform implementation.
|
The group is based on a default IntelliJ Platform implementation.
|
||||||
|
|
||||||
### Creating Simple Groups
|
### Creating Simple Groups
|
||||||
Grouping can be registered by adding a `<group>` element to the `<actions>` section of a plugin's `plugin.xml` file.
|
Grouping can be registered by adding a `<group>` element to the `<actions>` section of a plugin's <path>plugin.xml</path> file.
|
||||||
This example has no `class` attribute in the `<group>` element because the IntelliJ Platform framework will supply a default implementation class for the group.
|
This example has no `class` attribute in the `<group>` element because the IntelliJ Platform framework will supply a default implementation class for the group.
|
||||||
This default implementation is used if a set of actions belonging to the group is static, i.e., does not change at runtime, which is the majority of cases.
|
This default implementation is used if a set of actions belonging to the group is static, i.e., does not change at runtime, which is the majority of cases.
|
||||||
The `id` attribute must be unique, so incorporating the plugin ID or package name is the best practice.
|
The `id` attribute must be unique, so incorporating the plugin ID or package name is the best practice.
|
||||||
@ -88,7 +88,7 @@ As an example, extend [`DefaultActionGroup`](upsource:///platform/platform-api/s
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Registering the Custom Action Group
|
### Registering the Custom Action Group
|
||||||
As in the case with the static action group, the action `<group>` should be declared in the `<actions>` section of the `plugin.xml` file, for example, the [action_basics](https://github.com/JetBrains/intellij-sdk-code-samples/blob/main/action_basics/src/main/resources/META-INF/plugin.xml) plugin.
|
As in the case with the static action group, the action `<group>` should be declared in the `<actions>` section of the <path>plugin.xml</path> file, for example, the [action_basics](https://github.com/JetBrains/intellij-sdk-code-samples/blob/main/action_basics/src/main/resources/META-INF/plugin.xml) plugin.
|
||||||
For demonstration purposes, this implementation will use localization.
|
For demonstration purposes, this implementation will use localization.
|
||||||
|
|
||||||
The `<group>` element declaration below shows:
|
The `<group>` element declaration below shows:
|
||||||
|
@ -46,8 +46,8 @@ These methods fully implemented in [Developing the AnAction Methods](#developing
|
|||||||
Before fleshing out those methods, to complete this minimal implementation, `PopupDialogAction` must be registered with the IntelliJ Platform.
|
Before fleshing out those methods, to complete this minimal implementation, `PopupDialogAction` must be registered with the IntelliJ Platform.
|
||||||
|
|
||||||
## Registering a Custom Action
|
## Registering a Custom Action
|
||||||
Actions are registered by declaring them in code or by declaring them in the `<actions>` section of a plugin configuration (`plugin.xml`) file.
|
Actions are registered by declaring them in code or by declaring them in the `<actions>` section of a plugin configuration (<path>plugin.xml</path>) file.
|
||||||
This section describes using IDE tooling - the New Action Form - to add a declaration to the `plugin.xml` file, and then tuning registration attributes manually.
|
This section describes using IDE tooling - the New Action Form - to add a declaration to the <path>plugin.xml</path> file, and then tuning registration attributes manually.
|
||||||
A more comprehensive explanation of action registration is available in the [Action Registration](basic_action_system.md#registering-actions) section of this guide.
|
A more comprehensive explanation of action registration is available in the [Action Registration](basic_action_system.md#registering-actions) section of this guide.
|
||||||
|
|
||||||
### Registering an Action with the New Action Form
|
### Registering an Action with the New Action Form
|
||||||
@ -93,7 +93,7 @@ The `<add-to-group>` element declares where the action will appear and mirrors t
|
|||||||
This declaration is adequate, but adding more attributes is discussed in the next section.
|
This declaration is adequate, but adding more attributes is discussed in the next section.
|
||||||
|
|
||||||
### Setting Registration Attributes Manually
|
### Setting Registration Attributes Manually
|
||||||
An action declaration can be added manually to the `plugin.xml` file.
|
An action declaration can be added manually to the <path>plugin.xml</path> file.
|
||||||
An exhaustive list of declaration elements and attributes is presented in [Registering Actions in plugin.xml](basic_action_system.md#registering-actions-in-pluginxml).
|
An exhaustive list of declaration elements and attributes is presented in [Registering Actions in plugin.xml](basic_action_system.md#registering-actions-in-pluginxml).
|
||||||
Attributes are added by selecting them from the **New Action** form, or by editing the registration declaration directly in the plugin.xml file.
|
Attributes are added by selecting them from the **New Action** form, or by editing the registration declaration directly in the plugin.xml file.
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ The Simple Language parser is defined by subclassing [`ParserDefinition`](upsour
|
|||||||
{src="simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleParserDefinition.java"}
|
{src="simple_language_plugin/src/main/java/org/intellij/sdk/language/SimpleParserDefinition.java"}
|
||||||
|
|
||||||
## Register the Parser Definition
|
## Register the Parser Definition
|
||||||
Registering the parser definition in the `plugin.xml` file makes it available to the IntelliJ Platform.
|
Registering the parser definition in the <path>plugin.xml</path> file makes it available to the IntelliJ Platform.
|
||||||
Use the `com.intellij.lang.parserDefinition` extension point for registration.
|
Use the `com.intellij.lang.parserDefinition` extension point for registration.
|
||||||
For example, see `simple_language_plugin/src/main/resources/META-INF/plugin.xml`.
|
For example, see `simple_language_plugin/src/main/resources/META-INF/plugin.xml`.
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ To manage the contents of a tool window, call [`ToolWindow.getContentManager()`]
|
|||||||
To add a tab (content), first create it by calling [`ContentManager.getFactory().createContent()`](upsource:///platform/platform-api/src/com/intellij/ui/content/ContentManager.java), and then to add it to the tool window using [`ContentManager.addContent()`](upsource:///platform/platform-api/src/com/intellij/ui/content/ContentManager.java).
|
To add a tab (content), first create it by calling [`ContentManager.getFactory().createContent()`](upsource:///platform/platform-api/src/com/intellij/ui/content/ContentManager.java), and then to add it to the tool window using [`ContentManager.addContent()`](upsource:///platform/platform-api/src/com/intellij/ui/content/ContentManager.java).
|
||||||
|
|
||||||
A plugin can control whether the user is allowed to close tabs either globally or on a per-tab basis.
|
A plugin can control whether the user is allowed to close tabs either globally or on a per-tab basis.
|
||||||
The former is done by passing the `canCloseContents` parameter to the `registerToolWindow()` function, or by specifying `canCloseContents="true"` in `plugin.xml`.
|
The former is done by passing the `canCloseContents` parameter to the `registerToolWindow()` function, or by specifying `canCloseContents="true"` in <path>plugin.xml</path>.
|
||||||
The default value is `false`; calling `setClosable(true)` on `ContentManager` content will be ignored unless `canCloseContents` is explicitly set.
|
The default value is `false`; calling `setClosable(true)` on `ContentManager` content will be ignored unless `canCloseContents` is explicitly set.
|
||||||
If closing tabs is enabled in general, a plugin can disable closing of specific tabs by calling [`Content.setCloseable(false)`](upsource:///platform/platform-api/src/com/intellij/ui/content/Content.java).
|
If closing tabs is enabled in general, a plugin can disable closing of specific tabs by calling [`Content.setCloseable(false)`](upsource:///platform/platform-api/src/com/intellij/ui/content/Content.java).
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user