From 0e00edc6fcd406fcf38673ef6a2f8f59e8374de2 Mon Sep 17 00:00:00 2001 From: Vadim Mishenev Date: Mon, 28 Aug 2023 19:42:21 +0300 Subject: Support Dokka K2 analysis (#3094) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dokka has its own documentable model to represent analyzed code. The analysis is performed by a compiler frontend. In K1 the compiler frontend has descriptors that use the underlying Binding Context (global shared stateful structure). Dokka just maps descriptors to Documentable by DefaultDescriptorToDocumentableTranslator. K2 compiler has FIR tree, which means “Frontend Intermediate Representation”, instead of Binding Context. But we do not use FIR in Dokka directly, since it is too low-level for analysis. The Kotlin compiler provides high-level Analysis API for this case. The API is used by KSP too. Analysis API represent elements of FIR (declarations, parameters and so on) as Symbols. For more details see KtSymbolByFirBuilder, KtSymbol. For Dokka symbol is the replacement of descriptor in K2. Also, to set up the environment of project analysis in K1 we use idea dependencies (or copy-past from there). In K2 for these aims, there is a Standalone mode for Analysis API. --- .../test/kotlin/content/annotations/ContentForAnnotationsTest.kt | 6 ++---- .../base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt | 2 ++ 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/base/src/test/kotlin/content/annotations') diff --git a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt index 46239baa..82159e0d 100644 --- a/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/ContentForAnnotationsTest.kt @@ -10,10 +10,7 @@ import org.jetbrains.dokka.pages.ContentText import org.jetbrains.dokka.pages.MemberPageNode import org.jetbrains.dokka.pages.PackagePageNode import org.junit.jupiter.api.Test -import utils.ParamAttributes -import utils.assertNotNull -import utils.bareSignature -import utils.propertySignature +import utils.* import kotlin.test.assertEquals import kotlin.test.assertTrue @@ -318,6 +315,7 @@ class ContentForAnnotationsTest : BaseAbstractTest() { } } + @JavaCode @Test fun `annotated bounds in Java`() { testInline( diff --git a/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt b/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt index 961ce5f5..c25c1a1b 100644 --- a/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt +++ b/plugins/base/src/test/kotlin/content/annotations/JavaDeprecatedTest.kt @@ -9,10 +9,12 @@ import org.jetbrains.dokka.model.properties.WithExtraProperties import org.jetbrains.dokka.pages.ContentPage import org.jetbrains.dokka.pages.ContentStyle import org.junit.jupiter.api.Test +import utils.JavaCode import utils.pWrapped import kotlin.test.assertEquals import kotlin.test.assertTrue +@JavaCode class JavaDeprecatedTest : BaseAbstractTest() { private val testConfiguration = dokkaConfiguration { -- cgit