Search in sources :

Example 71 with IntentionAction

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

the class PostfixTemplateDescriptionNotFoundInspectionTest method testQuickFix.

public void testQuickFix() {
    myFixture.configureByFiles("MyQuickFixTemplate.java");
    IntentionAction item = myFixture.findSingleIntention("Create description file description.html");
    myFixture.launchAction(item);
    VirtualFile path = myFixture.findFileInTempDir("postfixTemplates/MyQuickFixTemplate/description.html");
    assertNotNull(path);
    assertTrue(path.exists());
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 72 with IntentionAction

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

the class RegisterExtensionFixProviderTest method testCreateLocalInspectionMapping.

public void testCreateLocalInspectionMapping() {
    myFixture.addClass("package com.intellij.codeInspection; public class LocalInspectionTool {} ");
    myFixture.testHighlighting("LocalInspection.java", "plugin.xml");
    IntentionAction intention = myFixture.findSingleIntention("Register inspection");
    myFixture.launchAction(intention);
    myFixture.checkResultByFile("plugin.xml", "localInspection.xml", true);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 73 with IntentionAction

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

the class RegisterExtensionFixProviderTest method testCreateGlobalInspectionMapping.

public void testCreateGlobalInspectionMapping() {
    myFixture.addClass("package com.intellij.codeInspection; public class GlobalInspectionTool {} ");
    myFixture.testHighlighting("GlobalInspection.java", "plugin.xml");
    IntentionAction intention = myFixture.findSingleIntention("Register inspection");
    myFixture.launchAction(intention);
    myFixture.checkResultByFile("plugin.xml", "globalInspection.xml", true);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 74 with IntentionAction

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

the class RegisterExtensionFixProviderTest method testCreateExtensionPointMappingWithKnownRequiredAttributeAndTag.

public void testCreateExtensionPointMappingWithKnownRequiredAttributeAndTag() {
    myFixture.addClass("package com.intellij.lang; public class LanguageExtensionPoint {}");
    myFixture.testHighlighting("MyLanguageExtensionPoint.java", "MyLanguageExtensionPointInterface.java", "extensionPointWithKnownRequiredAttributeAndTag.xml");
    IntentionAction intention = myFixture.findSingleIntention("Register extension");
    myFixture.launchAction(intention);
    myFixture.checkResultByFile("extensionPointWithKnownRequiredAttributeAndTag.xml", "extensionPointWithKnownRequiredAttributeAndTag_after.xml", true);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 75 with IntentionAction

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

the class RegisterExtensionFixProviderTest method testCreateExtensionPointMapping.

public void testCreateExtensionPointMapping() {
    myFixture.testHighlighting("MyExtensionPoint.java", "extensionPoint.xml", "ExtensionPoint.java");
    IntentionAction intention = myFixture.findSingleIntention("Register extension");
    myFixture.launchAction(intention);
    myFixture.checkResultByFile("extensionPoint.xml", "extensionPoint_after.xml", true);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Aggregations

IntentionAction (com.intellij.codeInsight.intention.IntentionAction)242 VirtualFile (com.intellij.openapi.vfs.VirtualFile)39 HighlightInfo (com.intellij.codeInsight.daemon.impl.HighlightInfo)31 NotNull (org.jetbrains.annotations.NotNull)23 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