|
17 | 17 | package com.goide.completion; |
18 | 18 |
|
19 | 19 | import com.intellij.codeInsight.lookup.Lookup; |
| 20 | +import com.intellij.codeInsight.lookup.LookupElement; |
| 21 | +import com.intellij.codeInsight.lookup.LookupElementPresentation; |
20 | 22 | import com.intellij.openapi.vfs.VfsUtil; |
21 | 23 | import com.intellij.openapi.vfs.VirtualFile; |
22 | 24 | import com.intellij.testFramework.TreePrintCondition; |
| 25 | +import com.intellij.util.ArrayUtil; |
23 | 26 | import com.intellij.util.containers.ContainerUtil; |
24 | 27 |
|
25 | 28 | import java.io.IOException; |
@@ -520,6 +523,17 @@ public void testPackageNamesInTestFile() { |
520 | 523 | myFixture.completeBasic(); |
521 | 524 | assertSameElements(myFixture.getLookupElementStrings(), "foo", "foo_test", "main"); |
522 | 525 | } |
| 526 | + |
| 527 | + public void testPointerSpecType() { |
| 528 | + myFixture.configureByText("foo.go", "package main; type a struct{};" + |
| 529 | + "func main() {q1, q2:=&a{};q<caret>}"); |
| 530 | + myFixture.completeBasic(); |
| 531 | + LookupElement first = ArrayUtil.getFirstElement(myFixture.getLookupElements()); |
| 532 | + assertNotNull(first); |
| 533 | + LookupElementPresentation presentation = new LookupElementPresentation(); |
| 534 | + first.renderElement(presentation); |
| 535 | + assertEquals("*main.a", presentation.getTypeText()); |
| 536 | + } |
523 | 537 |
|
524 | 538 | public void testPackageNamesInEmptyDirectory() throws IOException { |
525 | 539 | VirtualFile dir = myFixture.getTempDirFixture().findOrCreateDir("directory-name"); |
|
0 commit comments