use of org.jetbrains.idea.devkit.inspections.InspectionDescriptionInfo in project intellij-community by JetBrains.
the class DescriptionTypeRelatedItemLineMarkerProvider method process.
private static void process(PsiClass psiClass, Collection<? super RelatedItemLineMarkerInfo> result) {
if (!PsiUtil.isInstantiable(psiClass))
return;
Module module = ModuleUtilCore.findModuleForPsiElement(psiClass);
if (module == null)
return;
PsiElement highlightingElement = psiClass.getNameIdentifier();
if (highlightingElement == null)
return;
for (DescriptionType type : DescriptionType.values()) {
if (!InheritanceUtil.isInheritor(psiClass, type.getClassName())) {
continue;
}
String descriptionDirName = DescriptionCheckerUtil.getDescriptionDirName(psiClass);
if (StringUtil.isEmptyOrSpaces(descriptionDirName)) {
return;
}
if (type == DescriptionType.INSPECTION) {
final InspectionDescriptionInfo info = InspectionDescriptionInfo.create(module, psiClass);
if (info.hasDescriptionFile()) {
addDescriptionFileGutterIcon(highlightingElement, info.getDescriptionFile(), result);
}
return;
}
for (PsiDirectory descriptionDir : DescriptionCheckerUtil.getDescriptionsDirs(module, type)) {
PsiDirectory dir = descriptionDir.findSubdirectory(descriptionDirName);
if (dir == null)
continue;
final PsiFile descriptionFile = dir.findFile("description.html");
if (descriptionFile != null) {
addDescriptionFileGutterIcon(highlightingElement, descriptionFile, result);
addBeforeAfterTemplateFilesGutterIcon(highlightingElement, dir, result);
return;
}
}
return;
}
}
Aggregations