void (final PsiElement context, final String message, @NotNull final ErrorType type, final IntentionAction @NotNull ... fixes) { if (message != null && !message.isEmpty()) { final PsiFile containingFile = context.getContainingFile(); final HighlightInfoType defaultInfoType = type == ErrorType.ERROR ? HighlightInfoType.ERROR : type == ErrorType.WARNING ? HighlightInfoType.WARNING : HighlightInfoType.WEAK_WARNING; if (context instanceof XmlTag && XmlExtension.getExtension(containingFile).shouldBeHighlightedAsTag((XmlTag)context)) { addElementsForTagWithManyQuickFixes((XmlTag)context, message, defaultInfoType, fixes); } else { final PsiElement contextOfFile = InjectedLanguageManager.getInstance(containingFile.getProject()).getInjectionHost(containingFile); HighlightInfo.Builder builder; if (contextOfFile != null) { TextRange range = InjectedLanguageManager.getInstance(context.getProject()).injectedToHost(context, context.getTextRange()); builder = HighlightInfo.newHighlightInfo(defaultInfoType).range(range).descriptionAndTooltip(message); } else { builder = HighlightInfo.newHighlightInfo(HighlightInfoType.WRONG_REF).range(context).descriptionAndTooltip(message); } for (final IntentionAction quickFixAction : fixes) { if (quickFixAction == null) continue; builder.registerFix(quickFixAction, null, null, null, null); } myHolder.add(builder.create()); } } }