Search in sources :

Example 1 with CfmlParameterInfoHandler

use of com.intellij.coldFusion.UI.editorActions.CfmlParameterInfoHandler in project intellij-plugins by JetBrains.

the class CfmlParameterInfoTest method defaultTest.

private void defaultTest(String s) throws /*, int highlightedParameterIndex*/
Exception {
    myFixture.configureByFile(getTestName(false) + ".cfml");
    CfmlParameterInfoHandler parameterInfoHandler = new CfmlParameterInfoHandler();
    MockCreateParameterInfoContext createContext = new MockCreateParameterInfoContext(myFixture.getEditor(), myFixture.getFile());
    PsiElement elt = parameterInfoHandler.findElementForParameterInfo(createContext);
    assertNotNull(elt);
    parameterInfoHandler.showParameterInfo(elt, createContext);
    Object[] items = createContext.getItemsToShow();
    assertTrue(items != null);
    assertTrue(items.length > 0);
    MockParameterInfoUIContext context = new MockParameterInfoUIContext<>(elt);
    parameterInfoHandler.updateUI((CfmlFunctionDescription) items[0], context);
    assertEquals(s, parameterInfoHandler.getText());
    // index check
    MockUpdateParameterInfoContext updateContext = new MockUpdateParameterInfoContext(myFixture.getEditor(), myFixture.getFile());
    final PsiElement element = parameterInfoHandler.findElementForUpdatingParameterInfo(updateContext);
    parameterInfoHandler.updateParameterInfo(element, updateContext);
// assertEquals(highlightedParameterIndex, updateContext.getCurrentParameter());
}
Also used : MockUpdateParameterInfoContext(com.intellij.testFramework.utils.parameterInfo.MockUpdateParameterInfoContext) MockParameterInfoUIContext(com.intellij.testFramework.utils.parameterInfo.MockParameterInfoUIContext) CfmlParameterInfoHandler(com.intellij.coldFusion.UI.editorActions.CfmlParameterInfoHandler) MockCreateParameterInfoContext(com.intellij.testFramework.utils.parameterInfo.MockCreateParameterInfoContext) PsiElement(com.intellij.psi.PsiElement)

Aggregations

CfmlParameterInfoHandler (com.intellij.coldFusion.UI.editorActions.CfmlParameterInfoHandler)1 PsiElement (com.intellij.psi.PsiElement)1 MockCreateParameterInfoContext (com.intellij.testFramework.utils.parameterInfo.MockCreateParameterInfoContext)1 MockParameterInfoUIContext (com.intellij.testFramework.utils.parameterInfo.MockParameterInfoUIContext)1 MockUpdateParameterInfoContext (com.intellij.testFramework.utils.parameterInfo.MockUpdateParameterInfoContext)1