boolean (@NotNull PsiElement element) { HighlightDisplayKey unusedSymbolKey = HighlightDisplayKey.find(UnusedDeclarationInspectionBase.SHORT_NAME); PsiFile file = element.getContainingFile(); if (file == null) return false; InspectionProfile profile = InspectionProjectProfileManager.getInstance(file.getProject()).getCurrentProfile(); if (!profile.isToolEnabled(unusedSymbolKey, file)) { return false; } HighlightingLevelManager levelManager = HighlightingLevelManager.getInstance(file.getProject()); return levelManager.shouldInspect(file); }