Check that injection with annotation on parameter doesn't trigger not-stubbed psi

This commit is contained in:
Nikolay Krasko
2016-04-26 19:55:51 +03:00
parent dd8b667360
commit b8e2533b58
4 changed files with 26 additions and 6 deletions
@@ -39,6 +39,12 @@ public class KtParameterList extends KtElementImplStub<KotlinPlaceHolderStub<KtP
return visitor.visitParameterList(this, data);
}
@Override
public PsiElement getParent() {
KotlinPlaceHolderStub<KtParameterList> stub = getStub();
return stub != null ? stub.getParentStub().getPsi() : super.getParent();
}
@NotNull
public List<KtParameter> getParameters() {
return getStubOrPsiChildrenAsList(KtStubElementTypes.VALUE_PARAMETER);
@@ -49,11 +55,6 @@ public class KtParameterList extends KtElementImplStub<KotlinPlaceHolderStub<KtP
return EditCommaSeparatedListHelper.INSTANCE.addItem(this, getParameters(), parameter);
}
@NotNull
public KtParameter addParameterAfter(@NotNull KtParameter parameter, @Nullable KtParameter anchor) {
return EditCommaSeparatedListHelper.INSTANCE.addItemAfter(this, getParameters(), parameter, anchor);
}
@NotNull
public KtParameter addParameterBefore(@NotNull KtParameter parameter, @Nullable KtParameter anchor) {
return EditCommaSeparatedListHelper.INSTANCE.addItemBefore(this, getParameters(), parameter, anchor);