[Analysis API Standalone] fix wrongly registered KtLifetimeTokenProvider for standalone mode tests

`KtAnalysisSessionProvider` cached the incorrect `KtLifetimeTokenFactory` before the proper one was registered

^KT-60884
This commit is contained in:
Ilya Kirillov
2023-08-30 23:00:29 +02:00
committed by Space Team
parent 43a8ae98b7
commit a2015a6eb5
2 changed files with 10 additions and 2 deletions
@@ -26,7 +26,9 @@ import org.jetbrains.kotlin.psi.KtFile
@OptIn(KtAnalysisApiInternals::class)
public abstract class KtAnalysisSessionProvider(public val project: Project) : Disposable {
@KtAnalysisApiInternals
public val tokenFactory: KtLifetimeTokenFactory = KtLifetimeTokenProvider.getService(project).getLifetimeTokenFactory()
public val tokenFactory: KtLifetimeTokenFactory by lazy(LazyThreadSafetyMode.PUBLICATION) {
KtLifetimeTokenProvider.getService(project).getLifetimeTokenFactory()
}
@Suppress("LeakingThis")
public val noWriteActionInAnalyseCallChecker: NoWriteActionInAnalyseCallChecker = NoWriteActionInAnalyseCallChecker(this)