List<PsiReference> (@NotNull PyStringLiteralExpression element, int offset, @NotNull List<SectionBasedDocString.SectionField> fields, @Nullable ReferenceType nameRefType) { final List<PsiReference> result = new ArrayList<>(); for (SectionBasedDocString.SectionField field : fields) { for (Substring nameSub: field.getNamesAsSubstrings()) { if (nameRefType != null && nameSub != null && !nameSub.isEmpty()) { final TextRange range = nameSub.getTextRange().shiftRight(offset); result.add(new DocStringParameterReference(element, range, nameRefType)); } } final Substring typeSub = field.getTypeAsSubstring(); if (typeSub != null && !typeSub.isEmpty()) { result.addAll(parseTypeReferences(element, typeSub, offset)); } } return result; }