Drop 'propertyDelegated' convention (without additional deprecation ceremony).

This commit is contained in:
Dmitry Petrov
2016-12-06 15:35:23 +03:00
committed by Stanislav Erokhin
parent 5ddf8e60e6
commit e2b6d2d849
25 changed files with 8 additions and 300 deletions
@@ -40,7 +40,7 @@ class KtPropertyDelegationMethodsReference(element: KtPropertyDelegate) : KtMult
return (descriptor.accessors.mapNotNull {
accessor ->
context.get(BindingContext.DELEGATED_PROPERTY_RESOLVED_CALL, accessor)?.candidateDescriptor
} + listOfNotNull(context.get(BindingContext.DELEGATED_PROPERTY_PD_RESOLVED_CALL, descriptor)?.candidateDescriptor))
} + listOfNotNull(context.get(BindingContext.TO_DELEGATE_FOR_RESOLVED_CALL, descriptor)?.candidateDescriptor))
}
override val resolvesByNames: Collection<Name> get() = NAMES
@@ -1,16 +0,0 @@
// PSI_ELEMENT: org.jetbrains.kotlin.psi.KtNamedFunction
// OPTIONS: usages
import kotlin.reflect.KProperty
class Delegate() {
operator fun getValue(thisRef: Any?, property: KProperty<*>): String = ":)"
operator fun setValue(thisRef: Any?, property: KProperty<*>, value: String) {
}
operator fun <caret>propertyDelegated(property: KProperty<*>) {
}
}
var p: String by Delegate()
@@ -1,4 +0,0 @@
Resolved by Delegate()
Searched references to Delegate
Used plain search of Delegate.propertyDelegated(property: KProperty<*>) in LocalSearchScope:
CLASS:Delegate
@@ -1 +0,0 @@
Property delegation 16 var p: String by Delegate()
@@ -1,13 +0,0 @@
var x: Int <caret>by Foo()
class Foo
fun Foo.getValue(_this: Any?, p: Any?): Int = 1
fun Foo.setValue(_this: Any?, p: Any?, val: Any?) {}
fun Foo.propertyDelegated(p: Any?) {}
// MULTIRESOLVE
// REF: (for Foo in <root>).getValue(Any?, Any?)
// REF: (for Foo in <root>).setValue(Any?, Any?, Any?)
// REF: (for Foo in <root>).propertyDelegated(Any?)
@@ -1,13 +0,0 @@
var x: Int <caret>by Foo()
class Foo {
fun getValue(_this: Any?, p: Any?): Int = 1
fun setValue(_this: Any?, p: Any?, val: Any?) {}
fun propertyDelegated(p: Any?)
}
// MULTIRESOLVE
// REF: (in Foo).getValue(Any?, Any?)
// REF: (in Foo).setValue(Any?, Any?, Any?)
// REF: (in Foo).propertyDelegated(Any?)
@@ -145,12 +145,6 @@ public class FindUsagesTestGenerated extends AbstractFindUsagesTest {
doTest(fileName);
}
@TestMetadata("propertyDelegatedFunction.0.kt")
public void testPropertyDelegatedFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/conventions/propertyDelegatedFunction.0.kt");
doTest(fileName);
}
@TestMetadata("set.0.kt")
public void testSet() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/findUsages/kotlin/conventions/set.0.kt");
@@ -519,18 +519,6 @@ public class ReferenceResolveTestGenerated extends AbstractReferenceResolveTest
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getOneFakeOverride.kt");
doTest(fileName);
}
@TestMetadata("getSetPropertyDelegatedExtension.kt")
public void testGetSetPropertyDelegatedExtension() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedExtension.kt");
doTest(fileName);
}
@TestMetadata("getSetPropertyDelegatedMember.kt")
public void testGetSetPropertyDelegatedMember() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inSource/getSetPropertyDelegatedMember.kt");
doTest(fileName);
}
}
@TestMetadata("idea/testData/resolve/references/delegatedPropertyAccessors/inStandardLibrary")