plugin_extensions.md: structure EP properties

This commit is contained in:
Yann Cébron 2024-07-23 17:24:34 +02:00
parent 2e70043b97
commit d9c802bbc4
2 changed files with 43 additions and 22 deletions

View File

@ -20,6 +20,12 @@
Deprecated, see notes.
</primary-label>
<primary-label id="2019.2" short-name="2019.2+" name="2019.2+">
Available in IDE version 2019.2 or later
</primary-label>
<primary-label id="2019.3" short-name="2019.3+" name="2019.3">
Available in IDE version 2019.3 or later
</primary-label>
<primary-label id="2020.1" short-name="2020.1+" name="2020.1+">
Available in IDE version 2020.1 or later
</primary-label>

View File

@ -106,33 +106,48 @@ If an extension instance needs to "opt out" in certain scenarios, it can throw [
Several tooling features are available to help configure bean class extension points in <path>plugin.xml</path>.
Properties annotated with [`RequiredElement`](%gh-ic%/platform/core-api/src/com/intellij/openapi/extensions/RequiredElement.java) are inserted automatically and validated (2019.3 and later).
If the given property is allowed to have an explicit empty value, set `allowEmpty` to `true` (2020.3 and later).
#### Required Properties
<primary-label ref="2019.3"/>
Property names matching the following list will resolve to fully qualified class name:
Properties annotated with [`RequiredElement`](%gh-ic%/platform/core-api/src/com/intellij/openapi/extensions/RequiredElement.java) are inserted automatically and validated.
If the given property is allowed to have an explicit empty value, set `allowEmpty` to `true` (2020.3+).
#### Class names
Property names matching the following list will resolve to a fully qualified class name:
- `implementation`
- `className`
- `serviceInterface` / `serviceImplementation`
- ending with `Class` (case-sensitive)
- `serviceInterface`/`serviceImplementation`
A required parent type can be specified in the extension point declaration via nested [`<with>`](plugin_configuration_file.md#idea-plugin__extensionPoints__extensionPoint__with):
A required parent type can be specified in the [extension point declaration](plugin_extension_points.md) via [`<with>`](plugin_configuration_file.md#idea-plugin__extensionPoints__extensionPoint__with):
```xml
<extensionPoint name="myExtension" beanClass="MyExtensionBean">
<with
attribute="psiElementClass"
<with attribute="psiElementClass"
implements="com.intellij.psi.PsiElement"/>
</extensionPoint>
```
Property name `language` (or ending in `*Language`, 2020.2+) resolves to all present `Language` IDs.
#### Custom resolve
Similarly, `action`/`actionId` (2024.3+) resolves to all registered [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) IDs.
Property name `language` (or ending in `*Language`, 2020.2+) resolves to all present [`Language`](%gh-ic%/platform/core-api/src/com/intellij/lang/Language.java) IDs.
Annotating with [`@Nls`](%gh-java-annotations%/common/src/main/java/org/jetbrains/annotations/Nls.java) validates a UI `String` capitalization according to the text property `Capitalization` enum value (2019.2 and later).
Similarly, `action` and `actionId` (2024.3+) resolve to all registered [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) IDs.
#### Deprecation/ApiStatus
Properties marked as `@Deprecated` or annotated with any of [`ApiStatus`](%gh-java-annotations%/common/src/main/java/org/jetbrains/annotations/ApiStatus.java) `@Internal`, `@Experimental`, `@ScheduledForRemoval`, or `@Obsolete` will be highlighted accordingly.
Attributes with `Enum` type support code insight with _lowerCamelCased_ notation (2020.1 and later). Note: these must not override `toString()`.
#### Enum properties
<primary-label ref="2020.1"/>
Attributes with `Enum` type support code insight with _lowerCamelCased_ notation. Note: Enum implementation must not override `toString()`.
#### I18n
<primary-label ref="2019.2"/>
Annotating with [`@Nls`](%gh-java-annotations%/common/src/main/java/org/jetbrains/annotations/Nls.java) validates a UI `String` capitalization according to the text property `Capitalization` enum value.