Search in sources :

Example 26 with LocalInspectionTool

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

the class PythonInspectionsTest method testPyStringExceptionInspection.

public void testPyStringExceptionInspection() {
    LocalInspectionTool inspection = new PyStringExceptionInspection();
    doTest(getTestName(false), inspection);
}
Also used : LocalInspectionTool(com.intellij.codeInspection.LocalInspectionTool)

Example 27 with LocalInspectionTool

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

the class PythonInspectionsTest method testReturnValueFromInit.

public void testReturnValueFromInit() {
    LocalInspectionTool inspection = new PyReturnFromInitInspection();
    doTest(getTestName(true), inspection);
}
Also used : LocalInspectionTool(com.intellij.codeInspection.LocalInspectionTool)

Example 28 with LocalInspectionTool

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

the class PythonInspectionsTest method testPyDocstringInspection.

public void testPyDocstringInspection() {
    LocalInspectionTool inspection = new PyMissingOrEmptyDocstringInspection();
    doTest(getTestName(false), inspection);
}
Also used : LocalInspectionTool(com.intellij.codeInspection.LocalInspectionTool)

Example 29 with LocalInspectionTool

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

the class HtmlMissingClosingTagInspectionTest method highlightTest.

protected void highlightTest(@Language("HTML") String code) {
    final LocalInspectionTool inspection = getInspection();
    myFixture.enableInspections(inspection);
    final HighlightDisplayKey displayKey = HighlightDisplayKey.find(inspection.getShortName());
    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(HtmlFileType.INSTANCE, code);
    myFixture.testHighlighting();
}
Also used : Project(com.intellij.openapi.project.Project) InspectionProfileImpl(com.intellij.codeInspection.ex.InspectionProfileImpl) HighlightDisplayLevel(com.intellij.codeHighlighting.HighlightDisplayLevel) HighlightDisplayKey(com.intellij.codeInsight.daemon.HighlightDisplayKey) LocalInspectionTool(com.intellij.codeInspection.LocalInspectionTool)

Aggregations

LocalInspectionTool (com.intellij.codeInspection.LocalInspectionTool)29 NotNull (org.jetbrains.annotations.NotNull)11 ProblemsHolder (com.intellij.codeInspection.ProblemsHolder)4 HighlightDisplayLevel (com.intellij.codeHighlighting.HighlightDisplayLevel)3 LocalInspectionToolWrapper (com.intellij.codeInspection.ex.LocalInspectionToolWrapper)3 Project (com.intellij.openapi.project.Project)3 IOException (java.io.IOException)3 HighlightDisplayKey (com.intellij.codeInsight.daemon.HighlightDisplayKey)2 LocalInspectionToolSession (com.intellij.codeInspection.LocalInspectionToolSession)2 InspectionProfileImpl (com.intellij.codeInspection.ex.InspectionProfileImpl)2 InspectionToolWrapper (com.intellij.codeInspection.ex.InspectionToolWrapper)2 JavaLanguage (com.intellij.lang.java.JavaLanguage)2 PsiElementVisitor (com.intellij.psi.PsiElementVisitor)2 File (java.io.File)2 Language (org.intellij.lang.annotations.Language)2 Nls (org.jetbrains.annotations.Nls)2 NonNls (org.jetbrains.annotations.NonNls)2 com.intellij.codeHighlighting (com.intellij.codeHighlighting)1 EditorInfo (com.intellij.codeInsight.EditorInfo)1 CompletionContributor (com.intellij.codeInsight.completion.CompletionContributor)1