use of com.intellij.codeInspection.ex.InspectionManagerEx in project android by JetBrains.
the class AndroidTestCase method doGlobalInspectionTest.
/**
* Given an inspection and a path to a directory that contains an "expected.xml" file, run the
* inspection on the current test project and verify that its output matches that of the
* expected file.
*/
protected final void doGlobalInspectionTest(@NotNull GlobalInspectionToolWrapper wrapper, @NotNull String globalTestDir, @NotNull AnalysisScope scope) {
myFixture.enableInspections(wrapper.getTool());
scope.invalidate();
InspectionManagerEx inspectionManager = (InspectionManagerEx) InspectionManager.getInstance(getProject());
GlobalInspectionContextForTests globalContext = CodeInsightTestFixtureImpl.createGlobalContextForTool(scope, getProject(), inspectionManager, wrapper);
InspectionTestUtil.runTool(wrapper, scope, globalContext);
InspectionTestUtil.compareToolResults(globalContext, wrapper, false, getTestDataPath() + globalTestDir);
}
use of com.intellij.codeInspection.ex.InspectionManagerEx in project intellij-community by JetBrains.
the class ViewOfflineResultsAction method showOfflineView.
@NotNull
public static InspectionResultsView showOfflineView(@NotNull Project project, @NotNull Map<String, Map<String, Set<OfflineProblemDescriptor>>> resMap, @NotNull InspectionProfileImpl inspectionProfile, @NotNull String title) {
final AnalysisScope scope = new AnalysisScope(project);
final InspectionManagerEx managerEx = (InspectionManagerEx) InspectionManager.getInstance(project);
final GlobalInspectionContextImpl context = managerEx.createNewGlobalContext(false);
context.setExternalProfile(inspectionProfile);
context.setCurrentScope(scope);
context.initializeTools(new ArrayList<>(), new ArrayList<>(), new ArrayList<>());
final InspectionResultsView view = new InspectionResultsView(context, new OfflineInspectionRVContentProvider(resMap, project));
((RefManagerImpl) context.getRefManager()).startOfflineView();
context.addView(view, title, true);
view.update();
return view;
}
Aggregations