Search in sources :

Example 1 with AlphaUnsortedPropertiesFileInspection

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

the class AlphaUnsortedInspectionTest method testFixComments.

public void testFixComments() {
    myFixture.configureByText("p.properties", "a=a\n" + "d=d\n" + "# some comment on \"e\"\n" + "# this is multiline comment\n" + "e=e\n" + "b=b\n" + "c=b");
    myFixture.enableInspections(new AlphaUnsortedPropertiesFileInspection());
    final IntentionAction intention = myFixture.getAvailableIntention("Sort resource bundle files", "p.properties");
    assertNotNull(intention);
    myFixture.launchAction(intention);
    myFixture.checkResult("a=a\n" + "b=b\n" + "c=b\n" + "d=d\n" + "# some comment on \"e\"\n" + "# this is multiline comment\n" + "e=e");
}
Also used : AlphaUnsortedPropertiesFileInspection(com.intellij.codeInspection.unsorted.AlphaUnsortedPropertiesFileInspection) IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Example 2 with AlphaUnsortedPropertiesFileInspection

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

the class AlphaUnsortedInspectionTest method testFix.

public void testFix() {
    myFixture.configureByText("p.properties", "a=\n" + "c=\n" + "b=\\r\\n\\\n" + "f");
    myFixture.enableInspections(new AlphaUnsortedPropertiesFileInspection());
    final IntentionAction intention = myFixture.getAvailableIntention("Sort resource bundle files", "p.properties");
    assertNotNull(intention);
    myFixture.launchAction(intention);
    myFixture.checkResult("a=\n" + "b=\\r\\n\\\n" + "f\n" + "c=");
}
Also used : AlphaUnsortedPropertiesFileInspection(com.intellij.codeInspection.unsorted.AlphaUnsortedPropertiesFileInspection) IntentionAction(com.intellij.codeInsight.intention.IntentionAction)

Aggregations

IntentionAction (com.intellij.codeInsight.intention.IntentionAction)2 AlphaUnsortedPropertiesFileInspection (com.intellij.codeInspection.unsorted.AlphaUnsortedPropertiesFileInspection)2