KT-6820 Find usages doesn't find delegated properties when searching get/set/propertyDelegated functions

#KT-6820 fixed
This commit is contained in:
Evgeny Gerashchenko
2015-03-04 19:34:36 +03:00
parent 0a824edace
commit 8ba15937f9
12 changed files with 65 additions and 32 deletions
@@ -59,7 +59,7 @@ public class DelegatedPropertyResolver {
private CallResolver callResolver;
private KotlinBuiltIns builtIns;
private static final String PD_METHOD_NAME = "propertyDelegated";
public static final Name PROPERTY_DELEGATED_FUNCTION_NAME = Name.identifier("propertyDelegated");
@Inject
public void setExpressionTypingServices(@NotNull ExpressionTypingServices expressionTypingServices) {
@@ -147,13 +147,12 @@ public class DelegatedPropertyResolver {
List<JetExpression> arguments = Lists.newArrayList();
JetPsiFactory psiFactory = JetPsiFactory(delegateExpression);
arguments.add(createExpressionForPropertyMetadata(psiFactory, propertyDescriptor));
Name functionName = Name.identifier(PD_METHOD_NAME);
JetReferenceExpression fakeCalleeExpression = psiFactory.createSimpleName(functionName.asString());
JetReferenceExpression fakeCalleeExpression = psiFactory.createSimpleName(PROPERTY_DELEGATED_FUNCTION_NAME.asString());
ExpressionReceiver receiver = new ExpressionReceiver(delegateExpression, delegateType);
Call call = CallMaker.makeCallWithExpressions(fakeCalleeExpression, receiver, null, fakeCalleeExpression, arguments, Call.CallType.DEFAULT);
OverloadResolutionResults<FunctionDescriptor> functionResults =
callResolver.resolveCallWithGivenName(context, call, fakeCalleeExpression, functionName);
callResolver.resolveCallWithGivenName(context, call, fakeCalleeExpression, PROPERTY_DELEGATED_FUNCTION_NAME);
if (!functionResults.isSuccess()) {
String expectedFunction = renderCall(call, traceToResolvePDMethod.getBindingContext());