Package org.intellij.erlang

Examples of org.intellij.erlang.ErlangParameterInfoHandler


  public void testBif()       { doTest("bar() -> hash({}, <caret>)", 1); }
  public void testModuleBif() { doTest("bar() -> math:sin(<caret>)", 0); }

  private void doTest(String text, int highlightedParameterIndex) {
    myFixture.configureByText("a.erl", text);
    ErlangParameterInfoHandler parameterInfoHandler = new ErlangParameterInfoHandler();
    CreateParameterInfoContext createContext = new MockCreateParameterInfoContext(myFixture.getEditor(), myFixture.getFile());
    ErlangArgumentList list = parameterInfoHandler.findElementForParameterInfo(createContext);

    if (highlightedParameterIndex >= 0) {
      assertNotNull(list);
      parameterInfoHandler.showParameterInfo(list, createContext);
      Object[] itemsToShow = createContext.getItemsToShow();
      assertNotNull(itemsToShow);
      assertTrue(itemsToShow.length > 0);
    }
    MockUpdateParameterInfoContext updateContext = new MockUpdateParameterInfoContext(myFixture.getEditor(), myFixture.getFile());
    ErlangArgumentList element = parameterInfoHandler.findElementForUpdatingParameterInfo(updateContext);
    if (element == null) {
      assertEquals(-1, highlightedParameterIndex);
    }
    else {
      assertNotNull(element);
      //noinspection unchecked
      parameterInfoHandler.updateParameterInfo(element, updateContext);
      assertEquals(highlightedParameterIndex, updateContext.getCurrentParameter());
    }
  }
View Full Code Here

TOP

Related Classes of org.intellij.erlang.ErlangParameterInfoHandler

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.