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

Update Analysis API to 2.2.0-dev-326 #4004

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public final class org/jetbrains/dokka/analysis/java/ExceptionJavadocTag$Compani

public final class org/jetbrains/dokka/analysis/java/JavaAnalysisPlugin : org/jetbrains/dokka/plugability/DokkaPlugin {
public fun <init> ()V
public final fun disposeGlobalStandaloneApplicationServices ()V
public final fun getDocCommentCreators ()Lorg/jetbrains/dokka/plugability/ExtensionPoint;
public final fun getDocCommentFinder ()Lorg/jetbrains/dokka/analysis/java/doccomment/DocCommentFinder;
public final fun getDocCommentParsers ()Lorg/jetbrains/dokka/plugability/ExtensionPoint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,6 @@ public class JavaAnalysisPlugin : DokkaPlugin() {
DocCommentFinder(logger, docCommentFactory)
}

// TODO #3936(https://youtrack.jetbrains.com/issue/KT-71862) use an endpoint from AA
/**
* Disposes global resources which would persist after unloading Analysis API (Symbols analysis) and IJ platform classes.
*
* **Important:** Once this function has been called, Analysis API *and* IntelliJ platform classes should not be used anymore. The classes
* should either be unloaded or the whole program should be shut down.
*
* Note: Disposing of resources, including threads, allows unloading Dokka's class loader.
*/
@InternalDokkaApi
public fun disposeGlobalStandaloneApplicationServices() {
@Suppress("UnstableApiUsage")
com.intellij.util.concurrency.AppExecutorUtil.shutdownApplicationScheduledExecutorService()
}

internal val javaDocCommentCreator by extending {
docCommentCreators providing { JavaDocCommentCreator() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import org.jetbrains.dokka.analysis.kotlin.symbols.services.SymbolExternalDocume
import org.jetbrains.dokka.analysis.kotlin.symbols.translators.DefaultSymbolToDocumentableTranslator
import org.jetbrains.dokka.plugability.*
import org.jetbrains.dokka.renderers.PostAction
import org.jetbrains.kotlin.analysis.api.KaExperimentalApi
import org.jetbrains.kotlin.asJava.elements.KtLightAbstractAnnotation

@Suppress("unused")
Expand All @@ -38,13 +39,23 @@ public class SymbolsAnalysisPlugin : DokkaPlugin() {
}
}


internal val disposeKotlinAnalysisPostAction by extending {
CoreExtensions.postActions providing { context ->
PostAction {
querySingle { kotlinAnalysis }.close()
if (context.configuration.finalizeCoroutines)
// TODO #3936(https://youtrack.jetbrains.com/issue/KT-71862) use an endpoint from AA
javaAnalysisPlugin.disposeGlobalStandaloneApplicationServices()
if (context.configuration.finalizeCoroutines) {
/**
* Disposes global resources which would persist after unloading Analysis API (Symbols analysis) and IJ platform classes.
*
* **Important:** Once this function has been called, Analysis API *and* IntelliJ platform classes should not be used anymore. The classes
* should either be unloaded or the whole program should be shut down.
*
* Note: Disposing of resources, including threads, allows unloading Dokka's class loader.
*/
@OptIn(KaExperimentalApi::class)
org.jetbrains.kotlin.analysis.api.standalone.disposeGlobalStandaloneApplicationServices()
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,7 @@ internal class DokkaSymbolVisitor(
ExtraModifiers.KotlinOnlyModifiers.Const.takeIf { (this as? KaKotlinPropertySymbol)?.isConst == true },
ExtraModifiers.KotlinOnlyModifiers.LateInit.takeIf { (this as? KaKotlinPropertySymbol)?.isLateInit == true },
//ExtraModifiers.JavaOnlyModifiers.Static.takeIf { isJvmStaticInObjectOrClassOrInterface() },
// TODO https://youtrack.jetbrains.com/issue/KT-68236/Analysis-API-add-isExternal-property-for-KaPropertySymbol
ExtraModifiers.KotlinOnlyModifiers.External.takeIf { (psi as? KtProperty)?.hasModifier(KtTokens.EXTERNAL_KEYWORD) == true },
ExtraModifiers.KotlinOnlyModifiers.External.takeIf { isExternal },
//ExtraModifiers.KotlinOnlyModifiers.Static.takeIf { isStatic },
ExtraModifiers.KotlinOnlyModifiers.Override.takeIf {
origin != KaSymbolOrigin.SUBSTITUTION_OVERRIDE && origin != KaSymbolOrigin.INTERSECTION_OVERRIDE && isOverride
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ javaDiffUtils = "4.12"

## Analysis
kotlin-compiler = "2.0.20"
kotlin-compiler-k2 = "2.1.20-dev-4370"
kotlin-compiler-k2 = "2.2.0-dev-326"

# MUST match the version of the intellij platform used in the kotlin compiler,
# otherwise this will lead to different versions of psi API and implementations
Expand Down
Loading