Search in sources :

Example 6 with LookupElementPresentation

use of com.intellij.codeInsight.lookup.LookupElementPresentation in project intellij-community by JetBrains.

the class SmartType17CompletionTest method testDiamondPresentation.

public void testDiamondPresentation() {
    configureByFile("/" + getTestName(false) + ".java");
    LookupElementPresentation presentation = new LookupElementPresentation();
    myItems[0].renderElement(presentation);
    assertEquals("MyDD<>", presentation.getItemText());
}
Also used : LookupElementPresentation(com.intellij.codeInsight.lookup.LookupElementPresentation)

Example 7 with LookupElementPresentation

use of com.intellij.codeInsight.lookup.LookupElementPresentation in project intellij-elixir by KronicDeth.

the class CallDefinitionClauseTest method testIssue457ShorterName.

/*
     * Tests
     */
public void testIssue457ShorterName() {
    String name = "fo";
    LookupElement lookupElement = lookupElement(name);
    LookupElementPresentation lookupElementPresentation = new LookupElementPresentation();
    lookupElement.renderElement(lookupElementPresentation);
    assertEquals(name, lookupElementPresentation.getItemText());
}
Also used : LookupElementPresentation(com.intellij.codeInsight.lookup.LookupElementPresentation) LookupElement(com.intellij.codeInsight.lookup.LookupElement)

Example 8 with LookupElementPresentation

use of com.intellij.codeInsight.lookup.LookupElementPresentation in project intellij-elixir by KronicDeth.

the class CallDefinitionClauseTest method testIssue457LongerNameIssue503.

public void testIssue457LongerNameIssue503() {
    String name = "fooo";
    LookupElement lookupElement = lookupElement(name);
    LookupElementPresentation lookupElementPresentation = new LookupElementPresentation();
    lookupElement.renderElement(lookupElementPresentation);
    assertEquals(name, lookupElementPresentation.getItemText());
}
Also used : LookupElementPresentation(com.intellij.codeInsight.lookup.LookupElementPresentation) LookupElement(com.intellij.codeInsight.lookup.LookupElement)

Example 9 with LookupElementPresentation

use of com.intellij.codeInsight.lookup.LookupElementPresentation in project go-lang-idea-plugin by go-lang-plugin-org.

the class GoCompletionTest method testPointerSpecType.

public void testPointerSpecType() {
    myFixture.configureByText("foo.go", "package main; type a struct{};" + "func main() {q1, q2:=&a{};q<caret>}");
    myFixture.completeBasic();
    LookupElement first = ArrayUtil.getFirstElement(myFixture.getLookupElements());
    assertNotNull(first);
    LookupElementPresentation presentation = new LookupElementPresentation();
    first.renderElement(presentation);
    assertEquals("*main.a", presentation.getTypeText());
}
Also used : LookupElementPresentation(com.intellij.codeInsight.lookup.LookupElementPresentation) LookupElement(com.intellij.codeInsight.lookup.LookupElement)

Example 10 with LookupElementPresentation

use of com.intellij.codeInsight.lookup.LookupElementPresentation in project intellij-plugins by JetBrains.

the class ActionScriptCompletionTest method testTwoSdks.

public void testTwoSdks() throws Exception {
    final Sdk sdk45 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.5"), null, true);
    final Sdk sdk46 = FlexTestUtils.createSdk(FlexTestUtils.getPathToCompleteFlexSdk("4.6"), null, false);
    FlexTestUtils.modifyConfigs(myProject, new Consumer<FlexProjectConfigurationEditor>() {

        public void consume(final FlexProjectConfigurationEditor editor) {
            ModifiableFlexBuildConfiguration bc1 = editor.getConfigurations(myModule)[0];
            bc1.setName("1");
            FlexTestUtils.setSdk(bc1, sdk45);
            ModifiableFlexBuildConfiguration bc2 = editor.createConfiguration(myModule);
            bc2.setName("2");
            FlexTestUtils.setSdk(bc2, sdk46);
        }
    });
    final FlexBuildConfigurationManager m = FlexBuildConfigurationManager.getInstance(myModule);
    class TestZZ implements ThrowableRunnable<Exception> {

        private final String myBcName;

        private final String myExpectedTypeText;

        TestZZ(final String bcName, final String expectedTypeText) {
            myBcName = bcName;
            myExpectedTypeText = expectedTypeText;
        }

        @Override
        public void run() throws Exception {
            m.setActiveBuildConfiguration(m.findConfigurationByName(myBcName));
            defaultTest();
            for (LookupElement item : myItems) {
                final LookupElementPresentation p = new LookupElementPresentation();
                item.renderElement(p);
                assertEquals(myExpectedTypeText, p.getTypeText());
            }
        }
    }
    new TestZZ("1", sdk45.getName()).run();
    new TestZZ("2", sdk46.getName()).run();
    new TestZZ("1", sdk45.getName()).run();
}
Also used : FlexProjectConfigurationEditor(com.intellij.lang.javascript.flex.projectStructure.model.impl.FlexProjectConfigurationEditor) FlexBuildConfigurationManager(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager) ThrowableRunnable(com.intellij.util.ThrowableRunnable) LookupElementPresentation(com.intellij.codeInsight.lookup.LookupElementPresentation) Sdk(com.intellij.openapi.projectRoots.Sdk) LookupElement(com.intellij.codeInsight.lookup.LookupElement) ModifiableFlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)

Aggregations

LookupElementPresentation (com.intellij.codeInsight.lookup.LookupElementPresentation)18 LookupElement (com.intellij.codeInsight.lookup.LookupElement)10 LookupValueWithUIHint (com.intellij.codeInsight.lookup.LookupValueWithUIHint)2 RealLookupElementPresentation (com.intellij.codeInsight.lookup.RealLookupElementPresentation)2 SingleLineEmmetFilter (com.intellij.codeInsight.template.emmet.filters.SingleLineEmmetFilter)1 XmlZenCodingGenerator (com.intellij.codeInsight.template.emmet.generators.XmlZenCodingGenerator)1 ZenCodingGenerator (com.intellij.codeInsight.template.emmet.generators.ZenCodingGenerator)1 FlexBuildConfigurationManager (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfigurationManager)1 ModifiableFlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.ModifiableFlexBuildConfiguration)1 FlexProjectConfigurationEditor (com.intellij.lang.javascript.flex.projectStructure.model.impl.FlexProjectConfigurationEditor)1 AccessToken (com.intellij.openapi.application.AccessToken)1 Editor (com.intellij.openapi.editor.Editor)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiFile (com.intellij.psi.PsiFile)1 JBList (com.intellij.ui.components.JBList)1 ThrowableRunnable (com.intellij.util.ThrowableRunnable)1 HashSet (com.intellij.util.containers.HashSet)1