mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
plugin_dependencies.md: clarify optional dependencies sample
This commit is contained in:
parent
75fe71849c
commit
36253fde97
@ -160,13 +160,18 @@ Declare additional `optional="true"` and `config-file` attribute pointing to [op
|
|||||||
>
|
>
|
||||||
{style="note"}
|
{style="note"}
|
||||||
|
|
||||||
For example, if a plugin adds additional highlighting for Java and Kotlin files, use the following setup.
|
### Sample
|
||||||
The main <path>plugin.xml</path> will define an annotator for Java and specify an optional dependency on the Kotlin plugin (plugin ID `org.jetbrains.kotlin`):
|
|
||||||
|
The plugin adds additional highlighting for Java and Kotlin files.
|
||||||
|
The main <path>plugin.xml</path> defines a required dependency on the Java plugin (plugin ID `com.intellij.java`) and registers the corresponding `com.intellij.annotator` extension.
|
||||||
|
Additionally, it specifies an optional dependency on the Kotlin plugin (plugin ID `org.jetbrains.kotlin`):
|
||||||
|
|
||||||
<path>plugin.xml</path>
|
<path>plugin.xml</path>
|
||||||
```xml
|
```xml
|
||||||
<idea-plugin>
|
<idea-plugin>
|
||||||
...
|
...
|
||||||
|
<depends>com.intellij.java</depends>
|
||||||
|
|
||||||
<depends
|
<depends
|
||||||
optional="true"
|
optional="true"
|
||||||
config-file="myPluginId-withKotlin.xml">org.jetbrains.kotlin</depends>
|
config-file="myPluginId-withKotlin.xml">org.jetbrains.kotlin</depends>
|
||||||
@ -179,8 +184,8 @@ The main <path>plugin.xml</path> will define an annotator for Java and specify a
|
|||||||
</idea-plugin>
|
</idea-plugin>
|
||||||
```
|
```
|
||||||
|
|
||||||
Then create a file called <path>myPluginId-withKotlin.xml</path>, in the same directory as the main <path>plugin.xml</path> file.
|
The configuration file <path>myPluginId-withKotlin.xml</path> is located in the same directory as the main <path>plugin.xml</path> file.
|
||||||
In that file, define an annotator for Kotlin:
|
In that file, the annotator extension for Kotlin is defined:
|
||||||
|
|
||||||
<path>myPluginId-withKotlin.xml</path>
|
<path>myPluginId-withKotlin.xml</path>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user