void () { final List<PyInspectionExtension> extensions = PyInspectionExtension.EP_NAME.getExtensionList(); final List<PsiElement> unused = collectUnusedImportElements(); for (PsiElement element : unused) { if (extensions.stream().anyMatch(extension -> extension.ignoreUnused(element, myTypeEvalContext))) { continue; } if (element.getTextLength() > 0) { OptimizeImportsQuickFix fix = new OptimizeImportsQuickFix(); registerProblem(element, PyPsiBundle.message("INSP.unused.import.statement"), ProblemHighlightType.LIKE_UNUSED_SYMBOL, null, fix); } } }