protected InspectionTool[] getInspectionTools(PsiElement psiElement, InspectionManager manager) {
    final ModifiableModel model =
        InspectionProjectProfileManager.getInstance(manager.getProject())
            .getInspectionProfile()
            .getModifiableModel();
    InspectionProfileWrapper profile = new InspectionProfileWrapper((InspectionProfile) model);
    profile.init(manager.getProject());

    return profile.getInspectionTools(psiElement);
  }
Ejemplo n.º 2
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;
 }