private static void substituteReturnType(@NotNull PsiManager manager, @NotNull PsiMethod method, @Nullable PsiType returnType, @NotNull PsiSubstitutor substitutor) { final PsiTypeElement returnTypeElement = method.getReturnTypeElement(); if (returnTypeElement == null || returnType == null) { return; } final PsiType substitutedReturnType = substituteType(substitutor, returnType, method); returnTypeElement.replace(new LightTypeElement(manager, substitutedReturnType instanceof PsiWildcardType ? TypeConversionUtil.erasure(substitutedReturnType) : substitutedReturnType)); }
@NotNull @Override public PsiTypeElement createTypeElement(@NotNull final PsiType psiType) { final LightTypeElement element = new LightTypeElement(myManager, psiType); CodeEditUtil.setNodeGenerated(element.getNode(), true); return element; }
private static void substituteReturnType(@NotNull PsiManager manager, @NotNull PsiMethod method, @Nullable PsiType returnType, @NotNull PsiSubstitutor substitutor) { final PsiTypeElement returnTypeElement = method.getReturnTypeElement(); if(returnTypeElement == null || returnType == null) { return; } final PsiType substitutedReturnType = substituteType(substitutor, returnType, method); returnTypeElement.replace(new LightTypeElement(manager, substitutedReturnType instanceof PsiWildcardType ? TypeConversionUtil.erasure(substitutedReturnType) : substitutedReturnType)); }