Search in sources :

Example 1 with CallDefinitionClause

use of org.elixir_lang.structure_view.element.CallDefinitionClause in project intellij-elixir by KronicDeth.

the class GotoSymbolContributorTest method testIssue472.

/*
     * Tests
     */
public void testIssue472() {
    myFixture.configureByFile("issue_472.ex");
    ChooseByNameContributor[] symbolModelContributors = ChooseByNameRegistry.getInstance().getSymbolModelContributors();
    GotoSymbolContributor gotoSymbolContributor = null;
    for (ChooseByNameContributor symbolModelContributor : symbolModelContributors) {
        if (symbolModelContributor instanceof GotoSymbolContributor) {
            gotoSymbolContributor = (GotoSymbolContributor) symbolModelContributor;
        }
    }
    assertNotNull(gotoSymbolContributor);
    NavigationItem[] itemsByName = gotoSymbolContributor.getItemsByName("decode_auth_type", "decode_a", myFixture.getProject(), false);
    assertEquals(2, itemsByName.length);
    assertInstanceOf(itemsByName[0], CallDefinition.class);
    CallDefinition callDefinition = (CallDefinition) itemsByName[0];
    assertEquals("decode_auth_type", callDefinition.name());
    assertInstanceOf(itemsByName[1], CallDefinitionClause.class);
    CallDefinitionClause callDefinitionClause = (CallDefinitionClause) itemsByName[1];
    assertEquals("decode_auth_type", callDefinitionClause.getName());
}
Also used : NavigationItem(com.intellij.navigation.NavigationItem) CallDefinition(org.elixir_lang.structure_view.element.CallDefinition) ChooseByNameContributor(com.intellij.navigation.ChooseByNameContributor) CallDefinitionClause(org.elixir_lang.structure_view.element.CallDefinitionClause)

Aggregations

ChooseByNameContributor (com.intellij.navigation.ChooseByNameContributor)1 NavigationItem (com.intellij.navigation.NavigationItem)1 CallDefinition (org.elixir_lang.structure_view.element.CallDefinition)1 CallDefinitionClause (org.elixir_lang.structure_view.element.CallDefinitionClause)1