Skip to content

Commit

Permalink
Update Analysis API to 2.0.20-dev-7 (#3487)
Browse files Browse the repository at this point in the history
JetBrains/kotlin@bba5447 : `applicationDisposable` parameter is removed from `buildStandaloneAnalysisAPISession` because:
- It wasn’t used as the actual disposable for the shared application under the hood. In fact, logically it was just a second project disposable.
- The client should not need to care about application disposal, as signaling that the project is no longer used via the projectDisposable is sufficient.
  • Loading branch information
vmishenev committed Mar 28, 2024
1 parent 165dcea commit 31ec638
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ internal fun ProjectKotlinAnalysis(
internal class KotlinAnalysis(
private val sourceModules: SourceSetDependent<KtSourceModule>,
private val analysisSession: StandaloneAnalysisAPISession,
private val applicationDisposable: Disposable,
private val projectDisposable: Disposable
) : Closeable {

Expand All @@ -47,7 +46,6 @@ internal class KotlinAnalysis(
get() = analysisSession.modulesWithFiles

override fun close() {
Disposer.dispose(applicationDisposable)
Disposer.dispose(projectDisposable)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,12 @@ internal fun getLanguageVersionSettings(
internal fun createAnalysisSession(
sourceSets: List<DokkaConfiguration.DokkaSourceSet>,
logger: DokkaLogger,
applicationDisposable: Disposable = Disposer.newDisposable("StandaloneAnalysisAPISession.application"),
projectDisposable: Disposable = Disposer.newDisposable("StandaloneAnalysisAPISession.project"),
isSampleProject: Boolean = false
): KotlinAnalysis {
val sourcesModule = mutableMapOf<DokkaConfiguration.DokkaSourceSet, KtSourceModule>()

val analysisSession = buildStandaloneAnalysisAPISession(
applicationDisposable = applicationDisposable,
projectDisposable = projectDisposable,
withPsiDeclarationFromBinaryModuleProvider = false
) {
Expand Down Expand Up @@ -135,7 +133,7 @@ internal fun createAnalysisSession(
?: Platform.common.toTargetPlatform()
}
}
return KotlinAnalysis(sourcesModule, analysisSession, applicationDisposable, projectDisposable)
return KotlinAnalysis(sourcesModule, analysisSession, projectDisposable)
}

private enum class State {
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ kotlinx-bcv = "0.13.2"

## Analysis
kotlin-compiler = "1.9.22"
kotlin-compiler-k2 = "2.0.0-dev-8561"
kotlin-compiler-k2 = "2.0.20-dev-7"

# 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

0 comments on commit 31ec638

Please sign in to comment.