clarify or emphasize extension identifiers uniqueness

This commit is contained in:
Karol Lewandowski 2022-08-11 13:41:14 +02:00
parent e14683a072
commit d9167c5c79
3 changed files with 5 additions and 2 deletions

View File

@ -111,7 +111,8 @@ An example of inspecting PSI elements is demonstrated in the SDK code sample `ac
### Action IDs
Every action and action group has a unique identifier.
Basing the identifier for a custom action on the FQN of the implementation is the best practice, assuming the package incorporates the `<id>` of the plugin.
Basing the identifier for a custom action on the fully qualified name of the implementation is the best practice, assuming the package incorporates the `<id>` of the plugin.
Including the plugin identifier in the action identifier should prevent it from clashing with other plugins' actions.
An action must have a unique identifier for each place.
It is used in the IDE UI, even though the FQN of the implementation is the same.
Definitions of identifiers for the standard IntelliJ Platform actions are in [`IdeActions`](upsource:///platform/ide-core/src/com/intellij/openapi/actionSystem/IdeActions.java).

View File

@ -39,6 +39,8 @@ An implementation of a file-based index consists of the following main parts:
* `getValueExternalizer()` returns the [`DataExternalizer`](upsource:///platform/util/src/com/intellij/util/io/DataExternalizer.java) responsible for storing values in a serialized binary format.
* `getInputFilter()` allows restricting the indexing only to a certain set of files.
Consider using [`DefaultFileTypeSpecificInputFilter`](upsource:///platform/indexing-api/src/com/intellij/util/indexing/DefaultFileTypeSpecificInputFilter.java).
* `getName()` returns a unique index ID.
Consider using fully qualified index class name to not clash with other plugins defining index with the same ID, e.g.,&nbsp;`com.example.myplugin.indexing.MyIndex`.
* `getVersion()` returns the version of the index implementation.
The index is automatically rebuilt if the current version differs from the version of the index implementation used to build it.

View File

@ -73,7 +73,7 @@ and one extension to access the `another.plugin.myExtensionPoint` extension poin
The following properties are available always:
* `id` - unique ID
* `id` - unique ID. Consider prepending ID with the prefix related to the plugin name or ID to not clash with other plugins defining extensions with the same ID, e.g., `com.example.myplugin.myExtension`.
* `order` - allows ordering all defined extensions using `first`, `last` or `before|after [id]` respectively
* `os` - allows restricting an extension to given OS, e.g., `os="windows"` registers the extension on Windows only