-
Notifications
You must be signed in to change notification settings - Fork 409
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
Conversation
...org/jetbrains/dokka/analysis/kotlin/descriptors/compiler/CompilerDescriptorAnalysisPlugin.kt
Outdated
Show resolved
Hide resolved
...rains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorSampleAnalysisEnvironment.kt
Outdated
Show resolved
Hide resolved
...tlin/org/jetbrains/dokka/analysis/kotlin/symbols/services/SymbolSampleAnalysisEnvironment.kt
Outdated
Show resolved
Hide resolved
...tlin/org/jetbrains/dokka/analysis/kotlin/symbols/services/SymbolSampleAnalysisEnvironment.kt
Outdated
Show resolved
Hide resolved
59dc29d
to
bf38991
Compare
Squashed commits that fixed the API dump and some tests, but no major changes. |
There was a problem hiding this 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.
...lysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/sample/SampleSnippet.kt
Outdated
Show resolved
Hide resolved
...rains/dokka/analysis/kotlin/descriptors/compiler/impl/DescriptorSampleAnalysisEnvironment.kt
Outdated
Show resolved
Hide resolved
...tlin/org/jetbrains/dokka/analysis/kotlin/symbols/services/SymbolSampleAnalysisEnvironment.kt
Outdated
Show resolved
Hide resolved
...-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/sample/SampleAnalysisEnvironment.kt
Outdated
Show resolved
Hide resolved
...tlin/org/jetbrains/dokka/analysis/kotlin/symbols/services/SymbolSampleAnalysisEnvironment.kt
Outdated
Show resolved
Hide resolved
92aa97a
to
c978c5f
Compare
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 |
plugins/base/src/main/kotlin/transformers/pages/DefaultSamplesTransformer.kt
Outdated
Show resolved
Hide resolved
...lysis-kotlin-api/src/main/kotlin/org/jetbrains/dokka/analysis/kotlin/sample/SampleSnippet.kt
Outdated
Show resolved
Hide resolved
# 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
Should be addressed in #3359
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? { |
There was a problem hiding this comment.
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? " + |
There was a problem hiding this comment.
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.
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).