void (PsiJavaCodeReferenceElement reference, PsiElement context, boolean isOnTheFly, ProblemsHolder holder) { JavaResolveResult result = reference.advancedResolve(false); String refText = reference.getText(); String message = getResolveErrorMessage(result.getElement(), context, refText); if (message != null && !result.isPackagePrefixPackageReference()) { PsiElement element = Objects.requireNonNullElse(reference.getReferenceNameElement(), reference); LocalQuickFix fix = null; if (isOnTheFly) { List<? extends PsiClass> classesToImport = new ImportClassFix(reference).getClassesToImport(); if (!classesToImport.isEmpty()) { fix = new AddQualifierFix(classesToImport); } else if (URLUtil.HTTP_PROTOCOL.equals(refText) || URLUtil.HTTPS_PROTOCOL.equals(refText)) { PsiElement refHolder = reference.getParent(); if (refHolder != null && refHolder.getNode().getElementType() == JavaDocElementType.DOC_REFERENCE_HOLDER) { PsiElement adjacent = refHolder.getNextSibling(); if (adjacent instanceof PsiDocToken && ((PsiDocToken)adjacent).getTokenType() == JavaDocTokenType.DOC_COMMENT_DATA && adjacent.getText().startsWith(URLUtil.SCHEME_SEPARATOR)) { PsiDocComment docComment = PsiTreeUtil.getParentOfType(reference, PsiDocComment.class); if (docComment != null) { int startOffsetInDocComment = refHolder.getTextOffset() - docComment.getTextOffset(); int endOffsetInDocComment = refHolder.getTextOffset() + refText.length() + adjacent.getTextLength() - docComment.getTextOffset(); fix = LocalQuickFix.from(new UrlToHtmlFix(docComment, startOffsetInDocComment, endOffsetInDocComment)); } } } } } holder.registerProblem(holder.getManager().createProblemDescriptor( element, message, fix, ProblemHighlightType.LIKE_UNKNOWN_SYMBOL, isOnTheFly)); } }