Search in sources :

Example 1 with UnusedImportLocalInspection

use of com.intellij.codeInspection.unusedImport.UnusedImportLocalInspection in project intellij-community by JetBrains.

the class HighlightStressTest method configureLocalInspectionTools.

@NotNull
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
    if ("RandomEditingForUnused".equals(getTestName(false))) {
        return new LocalInspectionTool[] { new UnusedImportLocalInspection() };
    }
    List<InspectionToolWrapper> all = InspectionToolRegistrar.getInstance().createTools();
    List<LocalInspectionTool> locals = new ArrayList<>();
    for (InspectionToolWrapper tool : all) {
        if (tool instanceof LocalInspectionToolWrapper) {
            LocalInspectionTool e = ((LocalInspectionToolWrapper) tool).getTool();
            locals.add(e);
        }
    }
    return locals.toArray(new LocalInspectionTool[locals.size()]);
}
Also used : UnusedImportLocalInspection(com.intellij.codeInspection.unusedImport.UnusedImportLocalInspection) LocalInspectionTool(com.intellij.codeInspection.LocalInspectionTool) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper) InspectionToolWrapper(com.intellij.codeInspection.ex.InspectionToolWrapper) LocalInspectionToolWrapper(com.intellij.codeInspection.ex.LocalInspectionToolWrapper) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

LocalInspectionTool (com.intellij.codeInspection.LocalInspectionTool)1 InspectionToolWrapper (com.intellij.codeInspection.ex.InspectionToolWrapper)1 LocalInspectionToolWrapper (com.intellij.codeInspection.ex.LocalInspectionToolWrapper)1 UnusedImportLocalInspection (com.intellij.codeInspection.unusedImport.UnusedImportLocalInspection)1 NotNull (org.jetbrains.annotations.NotNull)1