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());
}
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());
}
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());
}
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());
}
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();
}
Aggregations