Using holder.registerProblem with ProblemHighlightType.INFORMATION gives me a warning saying that this is invisible. My inspection is kinda complicated that I don’t want to redo it in a separate annotator
Hi,
The recommended severity level for information-like problems is Weak Warning.
Declare the attribute in the plugin.xml (mind the caps):
<localInspection
level="WEAK WARNING"
... more attributes ...
/>
Then, in the inspection implementation, use registerProblem without any specific highlight type.
holder.registerProblem(psi, "Foo must not be a bar")
This will use the severity level declared in the plugin descriptor. Additionally, this will honour the inspection configuration and highlighting specified by the user in the Settings.
If the registerProblem requires an explicit highlight type, provide ProblemHighlightType.GENERIC_ERROR_OR_WARNING. This highlight type again honours the user inspection setting.
The INFORMATION severity level in the plugin.xml is generally used for inspections that do not produce any highlights. Even in such scenarios, use an implicit problem highlight type, or provide GENERIC_ERROR_OR_WARNING.