code_inspections_and_intentions.md: Cleanups

This commit is contained in:
Karol Lewandowski 2025-03-13 13:09:40 +01:00
parent 7c68d9601b
commit 0cf2f5da23

View File

@ -1,8 +1,8 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Code Inspections and Intentions
<link-summary>Introduction to analysing the code and providing quick fixes for the found issues.</link-summary>
<link-summary>Introduction to analyzing the code and providing quick fixes for the found issues.</link-summary>
<tldr>
@ -12,7 +12,7 @@
</tldr>
### Inspections
## Inspections
The code inspections for custom languages use the same API as all other code inspections, based on the [`LocalInspectionTool`](%gh-ic%/platform/analysis-api/src/com/intellij/codeInspection/LocalInspectionTool.java) class.
@ -25,21 +25,21 @@ The main differences are:
If none of that is required and the analysis only needs to run in the active editor, [Annotator](syntax_highlighting_and_error_highlighting.md#annotator) provides better performance (because it supports incremental analysis) and more flexibility for highlighting errors.
See [Inspections](inspections.md) topic in the UI Guidelines on naming, writing description, and message texts for inspections.
> See the [guidelines](inspections.md) on naming, writing description, and message texts for inspections.
**Examples:**
- [Code Inspections Tutorial](code_inspections.md)
- A [simple inspection](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/codeInspection/TrailingSpacesInPropertyInspection.java) for [Properties language plugin](%gh-ic%/plugins/properties)
- A [simple inspection](%gh-ic%/plugins/properties/properties-psi-impl/src/com/intellij/lang/properties/codeInspection/TrailingSpacesInPropertyInspection.java) for the [Properties language plugin](%gh-ic%/plugins/properties)
> Please also note important change in 2024.1, refer to [](syntax_highlighting_and_error_highlighting.md#order-of-running-highlighting).
> See changes in the [order of running highlighting](syntax_highlighting_and_error_highlighting.md#order-of-running-highlighting) introduced in 2024.1.
#### Inspections Performance
### Inspections Performance
<primary-label ref="2023.3"/>
A [custom language plugin](custom_language_support.md) providing many inspections (>100) can register the default [`PsiElementVisitor`](%gh-ic%/platform/core-api/src/com/intellij/psi/PsiElementVisitor.java)
for its language in `com.intellij.inspection.basicVisitor` extension point to optimize processing.
### Intentions
## Intentions
The code intentions for custom languages also use the standard API for intentions.
The intention classes need to implement the [`IntentionAction`](%gh-ic%/platform/analysis-api/src/com/intellij/codeInsight/intention/IntentionAction.java) interface and are registered using the `com.intellij.intentionAction` extension point.