inspection/reference: mention language attribute

This commit is contained in:
Yann Cébron 2022-08-10 15:56:08 +02:00
parent 896965f9c9
commit da95e4f611
2 changed files with 4 additions and 2 deletions

View File

@ -58,7 +58,9 @@ Contributing references is one of the most common ways to extend an existing lan
For example, your plugin can contribute references to Java code, even though the Java PSI is part of the platform and not defined in your plugin. For example, your plugin can contribute references to Java code, even though the Java PSI is part of the platform and not defined in your plugin.
Implement [`PsiReferenceContributor`](upsource:///platform/core-api/src/com/intellij/psi/PsiReferenceContributor.java) registered in `com.intellij.psi.referenceContributor` extension point. Implement [`PsiReferenceContributor`](upsource:///platform/core-api/src/com/intellij/psi/PsiReferenceContributor.java) registered in `com.intellij.psi.referenceContributor` extension point.
The places to contribute references to are then specified using [Element Patterns](element_patterns.md) in calls to `PsiReferenceRegistrar.registerReferenceProvider()`.
Attribute `language` should be set to the Language ID where this contributor applies to.
The exact places to contribute references to are then specified using [Element Patterns](element_patterns.md) in calls to `PsiReferenceRegistrar.registerReferenceProvider()`.
See also [Reference Contributor tutorial](reference_contributor.md). See also [Reference Contributor tutorial](reference_contributor.md).

View File

@ -59,7 +59,7 @@ There exist two types of inspection extensions:
* The `com.intellij.localInspection` extension point is used for inspections that operate on one file at a time, and also operate "on-the-fly" as the user edits the file. * The `com.intellij.localInspection` extension point is used for inspections that operate on one file at a time, and also operate "on-the-fly" as the user edits the file.
* The `com.intellij.globalInspection` extension point is used for inspections that operate across multiple files, and the associated fix might, for example, refactor code between files. * The `com.intellij.globalInspection` extension point is used for inspections that operate across multiple files, and the associated fix might, for example, refactor code between files.
The minimum inspection description must contain the `implementationClass` attribute. The minimum inspection setup must declare the `implementationClass` and `language` attribute (unless the inspection works on any supported language).
As shown in the `comparing_references_inspection` plugin configuration file, other attributes can be defined in the `localInspection` element, either with or without localization. As shown in the `comparing_references_inspection` plugin configuration file, other attributes can be defined in the `localInspection` element, either with or without localization.
In most cases, it is simplest to define the attributes in the plugin configuration file because the underlying parent classes handle most of the class responsibilities based on the configuration file description. In most cases, it is simplest to define the attributes in the plugin configuration file because the underlying parent classes handle most of the class responsibilities based on the configuration file description.
Note that some attributes are not displayed to the user, so they are never localized. Note that some attributes are not displayed to the user, so they are never localized.