void (@NotNull PsiElement target, @NotNull TextAttributesKey key, @NotNull HighlightSeverity severity) { final String message = myTestMode ? key.getExternalName() : null; // CodeInsightTestFixture#testHighlighting doesn't consider annotations with severity level < INFO final HighlightSeverity actualSeverity = myTestMode && severity.myVal < HighlightSeverity.INFORMATION.myVal ? HighlightSeverity.INFORMATION : severity; (message == null ? getHolder().newSilentAnnotation(actualSeverity) : getHolder().newAnnotation(actualSeverity, message)) .range(target).textAttributes(key).create(); }