Search in sources :

Example 6 with IntentionAction

use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.

the class PyUnresolvedReferencesInspectionTest method testIgnoredUnresolvedReferenceInUnionType.

// PY-11956
public void testIgnoredUnresolvedReferenceInUnionType() {
    final String testName = getTestName(true);
    final String inspectionName = getInspectionClass().getSimpleName();
    myFixture.configureByFile("inspections/" + inspectionName + "/" + testName + ".py");
    myFixture.enableInspections(getInspectionClass());
    final String attrQualifiedName = "inspections." + inspectionName + "." + testName + ".A.foo";
    final IntentionAction intentionAction = myFixture.findSingleIntention("Ignore unresolved reference '" + attrQualifiedName + "'");
    assertNotNull(intentionAction);
    myFixture.launchAction(intentionAction);
    myFixture.checkHighlighting(isWarning(), isInfo(), isWeakWarning());
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 7 with IntentionAction

use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.

the class PyIntentionTest method doTest.

private void doTest(String hint, boolean ignoreWhiteSpaces) {
    myFixture.configureByFile("intentions/" + getTestName(true) + ".py");
    final IntentionAction action = myFixture.findSingleIntention(hint);
    myFixture.launchAction(action);
    myFixture.checkResultByFile("intentions/" + getTestName(true) + "_after.py", ignoreWhiteSpaces);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 8 with IntentionAction

use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.

the class PyIntentionTest method doTest.

private void doTest(String hint) {
    myFixture.configureByFile("intentions/" + getTestName(true) + ".py");
    final IntentionAction action = myFixture.findSingleIntention(hint);
    myFixture.launchAction(action);
    myFixture.checkResultByFile("intentions/" + getTestName(true) + "_after.py");
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 9 with IntentionAction

use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.

the class PyIntentionTestCase method doIntentionTest.

protected void doIntentionTest(final String hint, String... files) {
    final String testFileName = getTestName(true);
    if (files.length > 0) {
        myFixture.configureByFiles(files);
    } else {
        myFixture.configureByFile(testFileName + ".py");
    }
    final IntentionAction intentionAction = myFixture.findSingleIntention(hint);
    assertNotNull(intentionAction);
    myFixture.launchAction(intentionAction);
    myFixture.checkResultByFile(testFileName + "_after.py", true);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 10 with IntentionAction

use of com.intellij.codeInsight.intention.IntentionAction in project intellij-community by JetBrains.

the class PyIntentionTestCase method doNegativeTest.

protected void doNegativeTest(final String hint) {
    final String testFileName = getTestName(true);
    myFixture.configureByFile(testFileName + ".py");
    final IntentionAction intentionAction = myFixture.getAvailableIntention(hint);
    assertNull(intentionAction);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Aggregations

IntentionAction (com.intellij.codeInsight.intention.IntentionAction)241 VirtualFile (com.intellij.openapi.vfs.VirtualFile)39 HighlightInfo (com.intellij.codeInsight.daemon.impl.HighlightInfo)31 NotNull (org.jetbrains.annotations.NotNull)22 Project (com.intellij.openapi.project.Project)20 TextRange (com.intellij.openapi.util.TextRange)20 Editor (com.intellij.openapi.editor.Editor)17 PsiFile (com.intellij.psi.PsiFile)17 Annotation (com.intellij.lang.annotation.Annotation)16 PsiElement (com.intellij.psi.PsiElement)16 Nullable (org.jetbrains.annotations.Nullable)15 ArrayList (java.util.ArrayList)14 LocalQuickFix (com.intellij.codeInspection.LocalQuickFix)10 QuickFixWrapper (com.intellij.codeInspection.ex.QuickFixWrapper)9 Pair (com.intellij.openapi.util.Pair)9 IncorrectOperationException (com.intellij.util.IncorrectOperationException)7 EmptyIntentionAction (com.intellij.codeInsight.intention.EmptyIntentionAction)6 AndroidMissingOnClickHandlerInspection (org.jetbrains.android.inspections.AndroidMissingOnClickHandlerInspection)6 HighlightDisplayLevel (com.intellij.codeHighlighting.HighlightDisplayLevel)5 HighlightDisplayKey (com.intellij.codeInsight.daemon.HighlightDisplayKey)5