void (@NotNull final CompletionParameters parameters, @NotNull final ProcessingContext context, @NotNull CompletionResultSet result) { final PsiElement position = parameters.getPosition(); boolean isArg = PsiJavaPatterns.psiElement().afterLeaf("(").accepts(position); PsiDocTag tag = PsiTreeUtil.getParentOfType(position, PsiDocTag.class); boolean onlyConstants = !isArg && tag != null && tag.getName().equals(VALUE_TAG); final PsiReference ref = position.getContainingFile().findReferenceAt(parameters.getOffset()); PsiElement refElement = ref == null ? null : ref.getElement(); if (refElement instanceof PsiDocParamRef) { result = result.withPrefixMatcher( refElement.getText().substring(0, parameters.getOffset() - refElement.getTextRange().getStartOffset())); for (PsiNamedElement param : getParametersToSuggest(PsiTreeUtil.getParentOfType(position, PsiDocComment.class))) { result.addElement(PrioritizedLookupElement.withPriority(LookupElementBuilder.create(param, nameForParamTag(param)), param instanceof PsiTypeParameter ? 0 : 1)); } } else if (ref instanceof PsiJavaReference) { result = JavaCompletionSorting.addJavaSorting(parameters, result); result.stopHere(); for (LookupElement item : completeJavadocReference(position, (PsiJavaReference)ref)) { if (onlyConstants) { if (!(item.getObject() instanceof PsiField field)) continue; if (!(field.hasModifierProperty(PsiModifier.STATIC) && field.getInitializer() != null && JavaConstantExpressionEvaluator.computeConstantExpression(field.getInitializer(), false) != null)) { continue; } } if (isArg) { item = AutoCompletionPolicy.NEVER_AUTOCOMPLETE.applyPolicy(item); } result.addElement(item); } JavaCompletionContributor.addAllClasses(parameters, result, new JavaCompletionSession(result)); } if (tag != null && "author".equals(tag.getName())) { result.addElement(LookupElementBuilder.create(SystemProperties.getUserName())); } }