mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[groovy] make SubstitutorComputer.obtainSubstitutor() accept resolveContext as PsiElement
This commit is contained in:
+2
-2
@@ -106,11 +106,11 @@ public class AccessorResolverProcessor extends MethodResolverProcessor {
|
||||
PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY);
|
||||
if (substitutor == null) substitutor = PsiSubstitutor.EMPTY;
|
||||
|
||||
final PsiElement resolveContext = state.get(RESOLVE_CONTEXT);
|
||||
if (mySubstitutorComputer != null) {
|
||||
substitutor = mySubstitutorComputer.obtainSubstitutor(substitutor, method, state);
|
||||
substitutor = mySubstitutorComputer.obtainSubstitutor(substitutor, method, resolveContext);
|
||||
}
|
||||
boolean isAccessible = isAccessible(method);
|
||||
final PsiElement resolveContext = state.get(RESOLVE_CONTEXT);
|
||||
final SpreadState spreadState = state.get(SpreadState.SPREAD_STATE);
|
||||
boolean isStaticsOK = isStaticsOK(method, resolveContext, false);
|
||||
final GroovyMethodResult candidate = new GroovyMethodResult(
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ public class MethodResolverProcessor extends ResolverProcessor<GroovyMethodResul
|
||||
if (substitutor == null) substitutor = PsiSubstitutor.EMPTY;
|
||||
|
||||
return myByShape ? substitutor
|
||||
: mySubstitutorComputer.obtainSubstitutor(substitutor, method, state);
|
||||
: mySubstitutorComputer.obtainSubstitutor(substitutor, method, state.get(RESOLVE_CONTEXT));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+4
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2014 JetBrains s.r.o.
|
||||
* Copyright 2000-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.
|
||||
@@ -112,7 +112,9 @@ public class SubstitutorComputer {
|
||||
return false;
|
||||
}
|
||||
|
||||
public PsiSubstitutor obtainSubstitutor(PsiSubstitutor substitutor, PsiMethod method, ResolveState state) {
|
||||
public PsiSubstitutor obtainSubstitutor(@NotNull PsiSubstitutor substitutor,
|
||||
@NotNull PsiMethod method,
|
||||
@Nullable PsiElement resolveContext) {
|
||||
final PsiTypeParameter[] typeParameters = method.getTypeParameters();
|
||||
if (myTypeArguments.length == typeParameters.length) {
|
||||
for (int i = 0; i < typeParameters.length; i++) {
|
||||
@@ -125,7 +127,6 @@ public class SubstitutorComputer {
|
||||
|
||||
if (myArgumentTypes != null && method.hasTypeParameters()) {
|
||||
PsiType[] argTypes = myArgumentTypes;
|
||||
final PsiElement resolveContext = state.get(ClassHint.RESOLVE_CONTEXT);
|
||||
if (method instanceof GrGdkMethod) {
|
||||
//type inference should be performed from static method
|
||||
PsiType[] newArgTypes = PsiType.createArray(argTypes.length + 1);
|
||||
|
||||
+1
-1
@@ -454,7 +454,7 @@ public class CompleteReferenceExpression {
|
||||
PsiSubstitutor substitutor = state.get(PsiSubstitutor.KEY);
|
||||
if (substitutor == null) substitutor = PsiSubstitutor.EMPTY;
|
||||
if (element instanceof PsiMethod) {
|
||||
substitutor = mySubstitutorComputer.obtainSubstitutor(substitutor, (PsiMethod)element, state);
|
||||
substitutor = mySubstitutorComputer.obtainSubstitutor(substitutor, (PsiMethod)element, resolveContext);
|
||||
}
|
||||
|
||||
consume(new GroovyResolveResultImpl(namedElement, resolveContext, spreadState, substitutor, isAccessible, isStaticsOK));
|
||||
|
||||
Reference in New Issue
Block a user