Package org.intellij.grammar.intention

Examples of org.intellij.grammar.intention.BnfFlipChoiceIntention


  public void testMultipleChoice() throws Exception {doTest("rule ::= a | b | c <caret>| d","rule ::= a | b | d | c");}
  public void testComplexCase() throws Exception {doTest("rule ::= a | b | c c c <caret>| d [d d]","rule ::= a | b | d [d d] | c c c");}

  private void doTest(/*@Language("BNF")*/ String text, /*@Language("BNF")*/ String expected) throws IOException {
    myFixture.configureByText("a.bnf", text);
    IntentionAction action = new BnfFlipChoiceIntention();
    assertTrue("intention not available", action.isAvailable(getProject(), myFixture.getEditor(), myFixture.getFile()));
    action.invoke(getProject(), myFixture.getEditor(), myFixture.getFile());
    assertSameLines(expected, myFixture.getFile().getText());
  }
View Full Code Here

TOP

Related Classes of org.intellij.grammar.intention.BnfFlipChoiceIntention

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.