use of org.jetbrains.kotlin.psi.KtPsiFactory in project kotlin by JetBrains.
the class KotlinCallableParameterTableModel method createRowItem.
@Override
protected ParameterTableModelItemBase<KotlinParameterInfo> createRowItem(@Nullable KotlinParameterInfo parameterInfo) {
if (parameterInfo == null) {
parameterInfo = new KotlinParameterInfo(methodDescriptor.getBaseDescriptor(), -1, "", new KotlinTypeInfo(false, null, null), null, null, KotlinValVar.None, null);
}
KtPsiFactory psiFactory = KtPsiFactoryKt.KtPsiFactory(project);
PsiCodeFragment paramTypeCodeFragment = psiFactory.createTypeCodeFragment(KotlinTypeInfoKt.render(parameterInfo.getCurrentTypeInfo()), myTypeContext);
KtExpression defaultValueForCall = parameterInfo.getDefaultValueForCall();
PsiCodeFragment defaultValueCodeFragment = psiFactory.createExpressionCodeFragment(defaultValueForCall != null ? defaultValueForCall.getText() : "", myDefaultValueContext);
return new ParameterTableModelItemBase<KotlinParameterInfo>(parameterInfo, paramTypeCodeFragment, defaultValueCodeFragment) {
@Override
public boolean isEllipsisType() {
return false;
}
};
}
Aggregations