use of com.intellij.codeInspection.LocalInspectionTool in project intellij-community by JetBrains.
the class ConvertFieldToLocalTest method configureLocalInspectionTools.
@NotNull
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
final FieldCanBeLocalInspection inspection = new FieldCanBeLocalInspection();
inspection.IGNORE_FIELDS_USED_IN_MULTIPLE_METHODS = false;
return new LocalInspectionTool[] { inspection };
}
use of com.intellij.codeInspection.LocalInspectionTool in project intellij-community by JetBrains.
the class UseBulkOperationInspectionTest method configureLocalInspectionTools.
@NotNull
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
UseBulkOperationInspection inspection = new UseBulkOperationInspection();
inspection.USE_ARRAYS_AS_LIST = true;
return new LocalInspectionTool[] { inspection };
}
use of com.intellij.codeInspection.LocalInspectionTool in project intellij-community by JetBrains.
the class RegExpInspectionTestCase method highlightTest.
protected void highlightTest(@Language("RegExp") String code) {
final LocalInspectionTool inspection = getInspection();
myFixture.enableInspections(inspection);
final HighlightDisplayKey displayKey = HighlightDisplayKey.find(inspection.getShortName());
if (displayKey != null) {
final Project project = myFixture.getProject();
final InspectionProfileImpl currentProfile = ProjectInspectionProfileManager.getInstance(project).getCurrentProfile();
final HighlightDisplayLevel errorLevel = currentProfile.getErrorLevel(displayKey, null);
if (errorLevel == HighlightDisplayLevel.DO_NOT_SHOW) {
currentProfile.setErrorLevel(displayKey, HighlightDisplayLevel.WARNING, project);
}
}
myFixture.configureByText(RegExpFileType.INSTANCE, code);
myFixture.testHighlighting();
}
use of com.intellij.codeInspection.LocalInspectionTool in project intellij-community by JetBrains.
the class SuppressModuleInfoInspectionsTest method testModuleInfo.
public void testModuleInfo() {
// need to set jdk version here because it is not set correctly in the mock jdk which causes problems in
// com.intellij.codeInspection.JavaSuppressionUtil#canHave15Suppressions()
IdeaTestUtil.setTestVersion(JavaSdkVersion.JDK_1_9, myFixture.getModule(), getTestRootDisposable());
final LocalInspectionTool inspection = new JavaDocReferenceInspection();
myFixture.enableInspections(inspection);
myFixture.configureByFile("module-info.java");
myFixture.testHighlighting();
myFixture.launchAction(myFixture.findSingleIntention("Suppress for module declaration"));
myFixture.checkResultByFile("module-info.after.java");
}
use of com.intellij.codeInspection.LocalInspectionTool in project intellij-community by JetBrains.
the class JavadocInspectionQuickFixTest method configureLocalInspectionTools.
@NotNull
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
final JavaDocLocalInspection javaDocLocalInspection = new JavaDocLocalInspection();
javaDocLocalInspection.TOP_LEVEL_CLASS_OPTIONS.REQUIRED_TAGS = "param";
javaDocLocalInspection.TOP_LEVEL_CLASS_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = "package";
javaDocLocalInspection.METHOD_OPTIONS.ACCESS_JAVADOC_REQUIRED_FOR = "package";
return new LocalInspectionTool[] { javaDocLocalInspection };
}
Aggregations