Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilize Sample analysis API #3195

Merged
merged 12 commits into from
Nov 21, 2023
Merged

Stabilize Sample analysis API #3195

merged 12 commits into from
Nov 21, 2023

Conversation

IgnatBeresnev
Copy link
Member

@IgnatBeresnev IgnatBeresnev commented Oct 5, 2023

Part of #3112, depends on #3184.

Moved the sample analysis API from internal to public, wrote documentation and a bunch of tests (obvious ones, corner cases + documentation contracts).

@IgnatBeresnev IgnatBeresnev self-assigned this Oct 5, 2023
@IgnatBeresnev
Copy link
Member Author

Squashed commits that fixed the API dump and some tests, but no major changes.

@IgnatBeresnev IgnatBeresnev added this to the Dokka 1.9.20 milestone Oct 13, 2023
Copy link
Contributor

@vmishenev vmishenev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should support stdlib.

@IgnatBeresnev IgnatBeresnev requested a review from whyoleg October 31, 2023 11:40
@IgnatBeresnev IgnatBeresnev changed the base branch from analysis-test-api to master October 31, 2023 22:45
@IgnatBeresnev
Copy link
Member Author

Rebased onto master, so I had to force push, but didn't squash any commits.

Also addressed the review comments, so it's ready for another round

# Conflicts:
#	dokka-subprojects/analysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/internal/SampleProvider.kt
#	dokka-subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/util/DokkaLoggerUtils.kt
#	dokka-subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/util/TestAnalysisApiUtils.kt
#	dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorSampleAnalysisEnvironment.kt
#	dokka-subprojects/analysis-kotlin-descriptors-compiler/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/impl/KotlinSampleProvider.kt
#	dokka-subprojects/analysis-kotlin-symbols/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/symbols/services/KotlinSampleProvider.kt
#	dokka-subprojects/analysis-kotlin-symbols/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/symbols/services/SymbolSampleAnalysisEnvironment.kt
# Conflicts:
#	dokka-subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/jvm/java/JavaConfigurationBuilder.kt
#	dokka-subprojects/analysis-kotlin-api/src/testFixtures/kotlin/org/jetbrains/dokka/analysis/test/api/jvm/kotlin/KotlinJvmConfigurationBuilder.kt
@IgnatBeresnev IgnatBeresnev merged commit 6fbc222 into master Nov 21, 2023
11 checks passed
internal fun KtAnalysisSession.resolveKDocLink(link: KDocLink): DRI? {
val lastNameSegment = link.children.filterIsInstance<KDocName>().lastOrNull()
val linkedSymbol = lastNameSegment?.mainReference?.resolveToSymbols()?.firstOrNull()
internal fun KtAnalysisSession.resolveKDocLinkDRI(link: KDocLink): DRI? {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name resolveKDocLinkToDRI is better.


if (kdocLink == null) {
dokkaLogger.warn(
"Unable to resolve a @sample link: \"$fqLink\". Is it used correctly? " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed in the first review the message does not have the location of sample link. It can be useful to find the link in the input code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants