Skip to content

Commit

Permalink
[Analysis API, KDoc] Prioritize ClassLikeSymbols in KDoc
Browse files Browse the repository at this point in the history
KDoc analysis only picks the first KaSymbol in the returned collection
to display to users, so it's only required to sort the resulting
collection

^KT-64190 fixed
  • Loading branch information
BlaBlaHuman authored and qodana-bot committed Oct 5, 2024
1 parent fa3a3db commit 6d375cf
Show file tree
Hide file tree
Showing 17 changed files with 85 additions and 1 deletion.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ internal object KDocReferenceResolver {
//ensure file context is provided for "non-physical" code as well
val contextDeclarationOrSelf = PsiTreeUtil.getContextOfType(contextElement, KtDeclaration::class.java, false)
?: contextElement
val fullSymbolsResolved = resolveKdocFqName(fullFqName, contextDeclarationOrSelf)
val fullSymbolsResolved =
resolveKdocFqName(fullFqName, contextDeclarationOrSelf).sortedByDescending { it.symbol is KaClassLikeSymbol }
if (selectedFqName == fullFqName) return fullSymbolsResolved.mapTo(mutableSetOf()) { it.symbol }
if (fullSymbolsResolved.isEmpty()) {
val parent = fullFqName.parent()
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
KtNamedFunction(0,32): '/**'
null
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
KtNamedFunction(0,32): '/**'
NO_CANDIDATES
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/**
* ref to [<caret>List]
*/
fun x(){}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
KDocName(14,18): 'List'
KDocReference:
(in kotlin.collections) interface List<out E> : kotlin.collections.Collection<E>

0 comments on commit 6d375cf

Please sign in to comment.