|
19 | 19 | import com.intellij.codeInsight.completion.CompletionType; |
20 | 20 | import com.intellij.codeInsight.lookup.Lookup; |
21 | 21 | import com.intellij.openapi.vfs.VirtualFile; |
22 | | -import com.intellij.testFramework.LightProjectDescriptor; |
23 | 22 |
|
24 | 23 | import java.io.IOException; |
25 | 24 |
|
26 | | -public class GoCompletionSdkAwareTest extends GoCompletionTestBase { |
27 | | - @Override |
28 | | - public void setUp() throws Exception { |
29 | | - super.setUp(); |
30 | | - setUpProjectSdk(); |
31 | | - } |
32 | | - |
33 | | - @Override |
34 | | - protected LightProjectDescriptor getProjectDescriptor() { |
35 | | - return createMockProjectDescriptor(); |
36 | | - } |
37 | | - |
| 25 | +public class GoCompletionSdkAwareTest extends GoCompletionSdkAwareTestBase { |
38 | 26 | public void testFormatter() { |
39 | 27 | doTestInclude("package main; import . \"fmt\"; type alias <caret>", "Formatter"); |
40 | 28 | } |
@@ -79,15 +67,15 @@ public void testFunctionAutoImport() { |
79 | 67 | "import \"fmt\"\n" + |
80 | 68 | "func test(){fmt.Fprintln(<caret>)}", "fmt.Fprintln"); |
81 | 69 | } |
82 | | - |
| 70 | + |
83 | 71 | public void testVariableAutoImport() { |
84 | 72 | doCheckResult("package main; \n" + |
85 | 73 | "func test(){ErrNotSuppor<caret>}", |
86 | 74 | "package main;\n" + |
87 | 75 | "import \"net/http\"\n" + |
88 | 76 | "func test(){http.ErrNotSupported}", "http.ErrNotSupported"); |
89 | 77 | } |
90 | | - |
| 78 | + |
91 | 79 | public void testConstantAutoImport() { |
92 | 80 | doCheckResult("package main; \n" + |
93 | 81 | "func test(){O_RDO<caret>}", "package main;\n" + |
@@ -298,14 +286,14 @@ public void testDoNotCompleteExampleFunctions() throws IOException { |
298 | 286 | myFixture.completeBasic(); |
299 | 287 | myFixture.checkResult("package a; func main() { _ = ExampleF<caret>"); |
300 | 288 | } |
301 | | - |
| 289 | + |
302 | 290 | public void testCompleteTestBenchmarkExamplesFromNonTestFiles() throws IOException { |
303 | 291 | myFixture.getTempDirFixture().createFile("pack/pack.go", "package pack; func TestFoo() {} func BenchmarkFoo() {} func ExampleFoo() {}"); |
304 | 292 | myFixture.configureByText("my_test.go", "package a; func main() { _ = Foo<caret>"); |
305 | 293 | myFixture.completeBasic(); |
306 | 294 | assertContainsElements(myFixture.getLookupElementStrings(), "pack.TestFoo", "pack.BenchmarkFoo", "pack.ExampleFoo"); |
307 | 295 | } |
308 | | - |
| 296 | + |
309 | 297 | public void testDoNotAutoImportWithTheSameImportPath() throws IOException { |
310 | 298 | myFixture.getTempDirFixture().createFile("pack1/file2.go", "package pack1; func MyFunctionFromSamePath() {}"); |
311 | 299 | myFixture.getTempDirFixture().createFile("pack2/file2.go", "package pack1; func MyFunctionFromOtherPath() {}"); |
|
0 commit comments