KT-738 No kotlin type completion in extend class scope

This commit is contained in:
Nikolay Krasko
2011-12-02 17:45:14 +04:00
parent 47050a11d1
commit 65fb8d40b7
8 changed files with 112 additions and 3 deletions
@@ -0,0 +1,13 @@
open class MySecondClass() {
}
open class MyFirstClass<T> {
}
class A() : My<caret> {
public fun test() {
}
}
// EXIST: MySecondClass, MyFirstClass
@@ -0,0 +1,10 @@
open class MyClass() {
}
class A() : My<caret> {
public fun test() {
val a : MyC<caret>
}
}
// EXIST: MyClass
@@ -0,0 +1,58 @@
package org.jetbrains.jet.completion;
import junit.framework.TestSuite;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.jet.JetTestCaseBuilder;
import org.jetbrains.jet.plugin.PluginTestCaseBase;
import java.io.File;
/**
* @author Nikolay.Krasko
*/
public class JetBasicCompletion extends JetCompletionTestBase {
private final String myPath;
private final String myName;
public JetBasicCompletion(@NotNull String path, @NotNull String name) {
myPath = path;
myName = name;
// Set name explicitly because otherwise there will be "TestCase.fName cannot be null"
setName("testCompletionExecute");
}
public void testCompletionExecute() {
doTest();
}
@Override
protected String getTestDataPath() {
return new File(PluginTestCaseBase.getTestDataPathBase(), myPath).getPath() +
File.separator;
}
@NotNull
@Override
public String getName() {
return "test" + myName;
}
@NotNull
public static TestSuite suite() {
TestSuite suite = new TestSuite();
JetTestCaseBuilder.appendTestsInDirectory(
PluginTestCaseBase.getTestDataPathBase(), "/completion/basic/", false,
JetTestCaseBuilder.emptyFilter, new JetTestCaseBuilder.NamedTestFactory() {
@NotNull
@Override
public junit.framework.Test createTest(@NotNull String dataPath, @NotNull String name) {
return new JetBasicCompletion(dataPath, name);
}
}, suite);
return suite;
}
}
@@ -22,10 +22,10 @@ public class KeywordsCompletionTest extends JetCompletionTestBase {
myName = name;
// Set name explicitly because otherwise there will be "TestCase.fName cannot be null"
setName("testComletionExecute");
setName("testCompletionExecute");
}
public void testComletionExecute() {
public void testCompletionExecute() {
doTest();
}