KT-8868 "Implement members" generates unqualified reference for member class/interface
#KT-8868 Fixed
This commit is contained in:
+2
-1
@@ -237,7 +237,8 @@ public abstract class OverrideImplementMembersHandler : LanguageCodeInsightActio
|
|||||||
val builder = StringBuilder()
|
val builder = StringBuilder()
|
||||||
builder.append("super")
|
builder.append("super")
|
||||||
if (classOrObject.getDelegationSpecifiers().size() > 1) {
|
if (classOrObject.getDelegationSpecifiers().size() > 1) {
|
||||||
builder.append("<").append(descriptor.containingDeclaration.escapedName()).append(">")
|
val superClassFqName = IdeDescriptorRenderers.SOURCE_CODE.renderClassifierName(descriptor.containingDeclaration as ClassifierDescriptor)
|
||||||
|
builder.append("<").append(superClassFqName).append(">")
|
||||||
}
|
}
|
||||||
builder.append(".").append(descriptor.escapedName())
|
builder.append(".").append(descriptor.escapedName())
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
class X : java.util.ArrayList<String>(), Runnable {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import java.util.ArrayList
|
||||||
|
|
||||||
|
class X : java.util.ArrayList<String>(), Runnable {
|
||||||
|
override fun size(): Int {
|
||||||
|
<selection><caret>return super<ArrayList>.size()</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
class Outer {
|
||||||
|
interface Inner1 {
|
||||||
|
fun f() { }
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Inner2 {
|
||||||
|
fun g() { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class X : Outer.Inner1, Outer.Inner2 {
|
||||||
|
<caret>
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
class Outer {
|
||||||
|
interface Inner1 {
|
||||||
|
fun f() { }
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Inner2 {
|
||||||
|
fun g() { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class X : Outer.Inner1, Outer.Inner2 {
|
||||||
|
override fun f() {
|
||||||
|
<selection><caret>super<Outer.Inner1>.f()</selection>
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -46,12 +46,12 @@ import kotlin.test.assertEquals
|
|||||||
public abstract class AbstractOverrideImplementTest : JetLightCodeInsightFixtureTestCase() {
|
public abstract class AbstractOverrideImplementTest : JetLightCodeInsightFixtureTestCase() {
|
||||||
override fun getProjectDescriptor(): LightProjectDescriptor = JetLightProjectDescriptor.INSTANCE
|
override fun getProjectDescriptor(): LightProjectDescriptor = JetLightProjectDescriptor.INSTANCE
|
||||||
|
|
||||||
protected fun doImplementFileTest() {
|
protected fun doImplementFileTest(memberToOverride: String? = null) {
|
||||||
doFileTest(ImplementMembersHandler())
|
doFileTest(ImplementMembersHandler(), memberToOverride)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun doOverrideFileTest() {
|
protected fun doOverrideFileTest(memberToOverride: String? = null) {
|
||||||
doFileTest(OverrideMembersHandler())
|
doFileTest(OverrideMembersHandler(), memberToOverride)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun doMultiImplementFileTest() {
|
protected fun doMultiImplementFileTest() {
|
||||||
@@ -62,11 +62,11 @@ public abstract class AbstractOverrideImplementTest : JetLightCodeInsightFixture
|
|||||||
doMultiFileTest(OverrideMembersHandler())
|
doMultiFileTest(OverrideMembersHandler())
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun doImplementDirectoryTest() {
|
protected fun doImplementDirectoryTest(memberToOverride: String? = null) {
|
||||||
doDirectoryTest(ImplementMembersHandler())
|
doDirectoryTest(ImplementMembersHandler(), memberToOverride)
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun doOverrideDirectoryTest(memberToImplement: String?) {
|
protected fun doOverrideDirectoryTest(memberToImplement: String? = null) {
|
||||||
doDirectoryTest(OverrideMembersHandler(), memberToImplement)
|
doDirectoryTest(OverrideMembersHandler(), memberToImplement)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,9 +91,9 @@ public abstract class AbstractOverrideImplementTest : JetLightCodeInsightFixture
|
|||||||
myFixture.checkResultByFile(getTestName(true) + "/foo/JavaClass.java.after")
|
myFixture.checkResultByFile(getTestName(true) + "/foo/JavaClass.java.after")
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun doFileTest(handler: OverrideImplementMembersHandler) {
|
private fun doFileTest(handler: OverrideImplementMembersHandler, memberToOverride: String? = null) {
|
||||||
myFixture.configureByFile(getTestName(true) + ".kt")
|
myFixture.configureByFile(getTestName(true) + ".kt")
|
||||||
doOverrideImplement(handler, null)
|
doOverrideImplement(handler, memberToOverride)
|
||||||
checkResultByFile(getTestName(true) + ".kt.after")
|
checkResultByFile(getTestName(true) + ".kt.after")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,11 +103,7 @@ public abstract class AbstractOverrideImplementTest : JetLightCodeInsightFixture
|
|||||||
checkResultByFile(getTestName(true) + ".kt.after")
|
checkResultByFile(getTestName(true) + ".kt.after")
|
||||||
}
|
}
|
||||||
|
|
||||||
protected fun doDirectoryTest(handler: OverrideImplementMembersHandler) {
|
private fun doDirectoryTest(handler: OverrideImplementMembersHandler, memberToOverride: String? = null) {
|
||||||
doDirectoryTest(handler, null)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun doDirectoryTest(handler: OverrideImplementMembersHandler, memberToOverride: String?) {
|
|
||||||
myFixture.copyDirectoryToProject(getTestName(true), "")
|
myFixture.copyDirectoryToProject(getTestName(true), "")
|
||||||
myFixture.configureFromTempProjectFile("foo/Impl.kt")
|
myFixture.configureFromTempProjectFile("foo/Impl.kt")
|
||||||
doOverrideImplement(handler, memberToOverride)
|
doOverrideImplement(handler, memberToOverride)
|
||||||
|
|||||||
@@ -1,225 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2015 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.codeInsight;
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.idea.core.overrideImplement.OverrideMembersHandler;
|
|
||||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
|
||||||
|
|
||||||
public final class OverrideImplementTest extends AbstractOverrideImplementTest {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setUp() {
|
|
||||||
super.setUp();
|
|
||||||
myFixture.setTestDataPath(PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/overrideImplement");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testEmptyClassBodyFunctionMethod() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFunctionMethod() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFunctionProperty() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFunctionWithTypeParameters() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGenericTypesSeveralMethods() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testJavaInterfaceMethod() {
|
|
||||||
doImplementDirectoryTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testJavaParameters() {
|
|
||||||
doImplementDirectoryTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFunctionFromTraitInJava() {
|
|
||||||
doImplementJavaDirectoryTest("foo.KotlinTrait", "bar");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGenericMethod() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testImplementJavaRawSubclass() {
|
|
||||||
doImplementDirectoryTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testProperty() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testTraitGenericImplement() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testDefaultValues() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testRespectCaretPosition() {
|
|
||||||
doMultiImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGenerateMulti() {
|
|
||||||
doMultiImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testTraitNullableFunction() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideUnitFunction() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideNonUnitFunction() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideFunctionProperty() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverridePrimitiveProperty() {
|
|
||||||
doMultiImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideGenericFunction() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testMultiOverride() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testDelegatedMembers() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideExplicitFunction() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideExtensionProperty() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideMutableExtensionProperty() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testComplexMultiOverride() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideRespectCaretPosition() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideJavaMethod() {
|
|
||||||
doOverrideDirectoryTest("getAnswer");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testJavaMethodWithPackageVisibility() {
|
|
||||||
doOverrideDirectoryTest("getFooBar");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testJavaMethodWithPackageProtectedVisibility() {
|
|
||||||
doOverrideDirectoryTest("getFooBar");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testPrivateJavaMethod() {
|
|
||||||
doMultiOverrideDirectoryTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testInheritVisibilities() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testImplementSamAdapters() {
|
|
||||||
doImplementDirectoryTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideFromFunctionPosition() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideFromClassName() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideFromLBrace() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testOverrideSamAdapters() {
|
|
||||||
doOverrideDirectoryTest("foo");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSameTypeName() {
|
|
||||||
doDirectoryTest(new OverrideMembersHandler());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testPropagationKJK() {
|
|
||||||
doDirectoryTest(new OverrideMembersHandler());
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testMultipleSupers() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testLocalClass() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testStarProjections() {
|
|
||||||
doImplementFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testEscapeIdentifiers() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testVarArgs() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testDoNotOverrideFinal() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testSuperPreference() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testAmbiguousSuper() {
|
|
||||||
doMultiOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testImplementFunctionType() {
|
|
||||||
doMultiImplementFileTest();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,231 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2015 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.codeInsight
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.idea.core.overrideImplement.OverrideMembersHandler
|
||||||
|
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||||
|
|
||||||
|
public class OverrideImplementTest : AbstractOverrideImplementTest() {
|
||||||
|
override fun setUp() {
|
||||||
|
super.setUp()
|
||||||
|
myFixture.testDataPath = PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/overrideImplement"
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testEmptyClassBodyFunctionMethod() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testFunctionMethod() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testFunctionProperty() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testFunctionWithTypeParameters() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testGenericTypesSeveralMethods() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testJavaInterfaceMethod() {
|
||||||
|
doImplementDirectoryTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testJavaParameters() {
|
||||||
|
doImplementDirectoryTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testFunctionFromTraitInJava() {
|
||||||
|
doImplementJavaDirectoryTest("foo.KotlinTrait", "bar")
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testGenericMethod() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testImplementJavaRawSubclass() {
|
||||||
|
doImplementDirectoryTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testProperty() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testTraitGenericImplement() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testDefaultValues() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testRespectCaretPosition() {
|
||||||
|
doMultiImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testGenerateMulti() {
|
||||||
|
doMultiImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testTraitNullableFunction() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideUnitFunction() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideNonUnitFunction() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideFunctionProperty() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverridePrimitiveProperty() {
|
||||||
|
doMultiImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideGenericFunction() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testMultiOverride() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testDelegatedMembers() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideExplicitFunction() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideExtensionProperty() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideMutableExtensionProperty() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testComplexMultiOverride() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideRespectCaretPosition() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideJavaMethod() {
|
||||||
|
doOverrideDirectoryTest("getAnswer")
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testJavaMethodWithPackageVisibility() {
|
||||||
|
doOverrideDirectoryTest("getFooBar")
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testJavaMethodWithPackageProtectedVisibility() {
|
||||||
|
doOverrideDirectoryTest("getFooBar")
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testPrivateJavaMethod() {
|
||||||
|
doMultiOverrideDirectoryTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testInheritVisibilities() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testImplementSamAdapters() {
|
||||||
|
doImplementDirectoryTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideFromFunctionPosition() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideFromClassName() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideFromLBrace() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testOverrideSamAdapters() {
|
||||||
|
doOverrideDirectoryTest("foo")
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testSameTypeName() {
|
||||||
|
doOverrideDirectoryTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testPropagationKJK() {
|
||||||
|
doOverrideDirectoryTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testMultipleSupers() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testLocalClass() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testStarProjections() {
|
||||||
|
doImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testEscapeIdentifiers() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testVarArgs() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testDoNotOverrideFinal() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testSuperPreference() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testAmbiguousSuper() {
|
||||||
|
doMultiOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testImplementFunctionType() {
|
||||||
|
doMultiImplementFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testQualifySuperType() {
|
||||||
|
doOverrideFileTest("f")
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testGenericSuperClass() {
|
||||||
|
doOverrideFileTest("size")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2015 JetBrains s.r.o.
|
|
||||||
*
|
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
* you may not use this file except in compliance with the License.
|
|
||||||
* You may obtain a copy of the License at
|
|
||||||
*
|
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
*
|
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
* See the License for the specific language governing permissions and
|
|
||||||
* limitations under the License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.idea.codeInsight;
|
|
||||||
|
|
||||||
import com.intellij.testFramework.LightProjectDescriptor;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.kotlin.idea.test.JdkAndMockLibraryProjectDescriptor;
|
|
||||||
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase;
|
|
||||||
|
|
||||||
public final class OverrideImplementWithLibTest extends AbstractOverrideImplementTest {
|
|
||||||
private static final String TEST_PATH = PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/overrideImplement/withLib";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setUp() {
|
|
||||||
super.setUp();
|
|
||||||
myFixture.setTestDataPath(TEST_PATH);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
@Override
|
|
||||||
protected LightProjectDescriptor getProjectDescriptor() {
|
|
||||||
return new JdkAndMockLibraryProjectDescriptor(TEST_PATH + "/" + getTestName(true) + "Src", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFakeOverride() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGenericSubstituted() {
|
|
||||||
doOverrideFileTest();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2015 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.idea.codeInsight
|
||||||
|
|
||||||
|
import com.intellij.testFramework.LightProjectDescriptor
|
||||||
|
import org.jetbrains.kotlin.idea.test.JdkAndMockLibraryProjectDescriptor
|
||||||
|
import org.jetbrains.kotlin.idea.test.PluginTestCaseBase
|
||||||
|
|
||||||
|
public class OverrideImplementWithLibTest : AbstractOverrideImplementTest() {
|
||||||
|
private val TEST_PATH = PluginTestCaseBase.getTestDataPathBase() + "/codeInsight/overrideImplement/withLib"
|
||||||
|
|
||||||
|
override fun setUp() {
|
||||||
|
super.setUp()
|
||||||
|
myFixture.testDataPath = TEST_PATH
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun getProjectDescriptor() = JdkAndMockLibraryProjectDescriptor(TEST_PATH + "/" + getTestName(true) + "Src", false)
|
||||||
|
|
||||||
|
public fun testFakeOverride() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun testGenericSubstituted() {
|
||||||
|
doOverrideFileTest()
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user