List<PsiNamedElement> (@NotNull PsiDocComment comment) { List<PsiNamedElement> allParams = new ArrayList<>(); PsiJavaDocumentedElement owner = comment.getOwner(); if (owner instanceof PsiMethod) { Collections.addAll(allParams, ((PsiMethod)owner).getParameterList().getParameters()); } if (owner instanceof PsiMethod || owner instanceof PsiClass) { PsiTypeParameterList tpl = ((PsiTypeParameterListOwner)owner).getTypeParameterList(); if (tpl != null) { Collections.addAll(allParams, tpl.getTypeParameters()); } } if (owner instanceof PsiClass && ((PsiClass)owner).isRecord()) { Collections.addAll(allParams, ((PsiClass)owner).getRecordComponents()); } return allParams; }