interface InspectionSyntax :
Inspection's are easily recognized as “QuickFixes” when the user hit’s a KeyShortCut for missing imports.
Interestingly enough, despite calling
Inspection's proverbially “QuickFixes”, IntelliJ defines a
QuickFix as an aggregation of multiple
Intention's analysis your code and users can decide whether they want to apply a suggested Fix,
Inspection’s improve upon that very idea and are capable to block the user to compile code at the first place.
Additionally, we can scope the Fix in
applyTo locally, for each instance per file, or globally to the whole project, assuming it has a universal refactoring task.
There are cases, where an universal Fix, might not be obvious, but that doesn’t stop plugin developer’s to notify and direct user’s to helpful resources about this problem.
|addApplicableInspection||registers a Local ApplicableInspection and has KtPsiFactory in Scope to modify the element, project or editor at once within applyTo. The following example is a simplified purityPlugin, where every function that returns Unit has to be suspended. Otherwise the code can not be compiled.
|addGlobalInspection||registers a GlobalInspection. InspectionEP is once again a wrapper over the actual GlobalInspectionTool.
|addInspectionSuppressor||registers an InspectionSuppressor for the specified PsiElement.
|addLocalInspection||registers a LocalInspection. LocalInspectionEP is solely a wrapper over the generic InspectionProfileEntry, which is a Subtype of both GlobalInspectionTool and LocalInspectionTool.
Do you like Arrow?✖