Ejemplo n.º 1
0
 private InspectionTool getTool(final RefEntity refEntity) {
   InspectionTool tool = getTool();
   assert tool != null;
   final GlobalInspectionContextImpl manager = tool.getContext();
   if (manager == null) return tool;
   if (refEntity instanceof RefElement) {
     PsiElement element = ((RefElement) refEntity).getElement();
     if (element == null) return tool;
     final InspectionProfileWrapper profileWrapper =
         InspectionProjectProfileManagerImpl.getInstanceImpl(manager.getProject())
             .getProfileWrapper();
     if (profileWrapper == null) return tool;
     tool = profileWrapper.getInspectionTool(tool.getShortName(), element);
   }
   return tool;
 }
 protected static String getTextAttributeKey(
     @NotNull Project project,
     @NotNull HighlightSeverity severity,
     @NotNull ProblemHighlightType highlightType) {
   if (highlightType == ProblemHighlightType.LIKE_DEPRECATED) {
     return HighlightInfoType.DEPRECATED.getAttributesKey().getExternalName();
   }
   if (highlightType == ProblemHighlightType.LIKE_UNKNOWN_SYMBOL
       && severity == HighlightSeverity.ERROR) {
     return HighlightInfoType.WRONG_REF.getAttributesKey().getExternalName();
   }
   if (highlightType == ProblemHighlightType.LIKE_UNUSED_SYMBOL) {
     return HighlightInfoType.UNUSED_SYMBOL.getAttributesKey().getExternalName();
   }
   SeverityRegistrar registrar =
       InspectionProjectProfileManagerImpl.getInstanceImpl(project).getSeverityRegistrar();
   return registrar.getHighlightInfoTypeBySeverity(severity).getAttributesKey().getExternalName();
 }