Associate synthetic component function descriptors with corresponding

constructor parameters
This commit is contained in:
Alexey Sedunov
2014-08-05 17:57:53 +04:00
parent 386e39f4a2
commit 311166737f
13 changed files with 59 additions and 17 deletions
@@ -33,6 +33,8 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.PathUtil;
import com.intellij.util.SmartList;
import kotlin.Function1;
import kotlin.KotlinPackage;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jet.lang.psi.*;
@@ -257,7 +259,15 @@ public class LightClassUtil {
if (getterWrapper == null || setterWrapper == null) {
// If some getter or setter isn't found yet try to get it from wrappers for general declaration
List<PsiMethod> wrappers = getPsiMethodWrappers(jetDeclaration, true);
List<PsiMethod> wrappers = KotlinPackage.filter(
getPsiMethodWrappers(jetDeclaration, true),
new Function1<PsiMethod, Boolean>() {
@Override
public Boolean invoke(PsiMethod method) {
return JvmAbi.isAccessorName(method.getName());
}
}
);
assert wrappers.size() <= 2 : "Maximum two wrappers are expected to be generated for declaration: " + jetDeclaration.getText();
for (PsiMethod wrapper : wrappers) {