A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://plugins.jetbrains.com/docs/intellij/code-inspections-and-intentions.html below:

Code Inspections and Intentions | IntelliJ Platform Plugin SDK

Code Inspections and Intentions

Code inspections analyze code for potential issues, such as errors, inefficiencies, or code smells. Code intentions suggest improvements and refactorings to enhance readability and maintainability.

While inspections focus on detecting problems, intentions provide optional enhancements to improve code structure. Inspections are run on a full PSI tree and report found problems, while intention actions are run only on elements under the cursor.

Inspections

The code inspections for custom languages use the same API as all other code inspections, based on the LocalInspectionTool class.

The functionality of LocalInspectionTool partially duplicates that of Annotator.

The main differences are:

If none of that is required and the analysis only needs to run in the active editor, Annotator provides better performance (because it supports incremental analysis) and more flexibility for highlighting errors.

Examples:

See changes in the order of running highlighting introduced in 2024.1.

Inspections Performance

A custom language plugin providing many inspections (>100) can register the default PsiElementVisitor for its language in com.intellij.inspection.basicVisitor extension point to optimize processing.

Intentions

The code intentions for custom languages also use the standard API for intentions. The intention classes need to implement the IntentionAction interface and are registered using the com.intellij.intentionAction extension point.

Examples:

19 March 2025


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4