Search in sources :

Example 1 with MisspelledHeaderInspection

use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.

the class MisspelledHeaderInspectionTest method testFix.

public void testFix() {
    myFixture.enableInspections(new MisspelledHeaderInspection());
    myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, "ManifestVersion: 1.0\n");
    List<IntentionAction> intentions = myFixture.filterAvailableIntentions("Change to");
    assertEquals(1, intentions.size());
    myFixture.launchAction(intentions.get(0));
    myFixture.checkResult("Manifest-Version: 1.0\n");
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction) MisspelledHeaderInspection(org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection)

Example 2 with MisspelledHeaderInspection

use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.

the class MisspelledHeaderInspectionTest method testCustomHeaderFix.

public void testCustomHeaderFix() {
    MisspelledHeaderInspection inspection = new MisspelledHeaderInspection();
    myFixture.enableInspections(inspection);
    myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, "Custom-Header: -\n");
    List<IntentionAction> intentions = myFixture.filterAvailableIntentions("Add ");
    assertEquals(1, intentions.size());
    myFixture.launchAction(intentions.get(0));
    assertEquals(Collections.singleton("Custom-Header"), inspection.CUSTOM_HEADERS);
}
Also used : IntentionAction(com.intellij.codeInsight.intention.IntentionAction) MisspelledHeaderInspection(org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection)

Example 3 with MisspelledHeaderInspection

use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.

the class MisspelledHeaderInspectionTest method doTest.

private void doTest(String text, int expected) {
    myFixture.enableInspections(new MisspelledHeaderInspection());
    myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, text + "\n");
    myFixture.checkHighlighting();
    assertEquals(expected, myFixture.filterAvailableIntentions("Change to").size());
}
Also used : MisspelledHeaderInspection(org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection)

Example 4 with MisspelledHeaderInspection

use of org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection in project intellij-community by JetBrains.

the class MisspelledHeaderInspectionTest method testCustomHeader.

public void testCustomHeader() {
    MisspelledHeaderInspection inspection = new MisspelledHeaderInspection();
    inspection.CUSTOM_HEADERS.add("Custom-Header");
    myFixture.enableInspections(inspection);
    myFixture.configureByText(ManifestFileTypeFactory.MANIFEST, "Custom-Header: -\n");
    myFixture.checkHighlighting();
}
Also used : MisspelledHeaderInspection(org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection)

Aggregations

MisspelledHeaderInspection (org.jetbrains.lang.manifest.highlighting.MisspelledHeaderInspection)4 IntentionAction (com.intellij.codeInsight.intention.IntentionAction)2