[analysis api] fix KDoc for the analyze function
This commit is contained in:
@@ -19,14 +19,14 @@ import org.jetbrains.kotlin.psi.KtFile
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute given [action] in [KtAnalysisSession] context
|
* Execute given [action] in [KtAnalysisSession] context
|
||||||
* Uses [useSiteKtElement] to get a module from which you would like to see the other modules
|
* Uses [useSiteKtElement] as an [KtElement] which containing module is a use-site module,
|
||||||
* Usually [useSiteKtElement] is some element form the module you currently analysing now
|
* i.e, the module from which perspective the project will be analyzed.
|
||||||
*
|
*
|
||||||
* Should not be called from EDT thread
|
* [nonDefaultLifetimeTokenFactory] represents lifetime and accessibility guaranties
|
||||||
* Should be called from read action
|
* which will be applied to the [org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeOwner] instances created during code analysis.
|
||||||
* To analyse something from EDT thread, consider using [analyzeInModalWindow]
|
|
||||||
*
|
*
|
||||||
* @see KtAnalysisSession
|
* @see KtAnalysisSession
|
||||||
|
* @see KtLifetimeTokenFactory
|
||||||
* @see analyzeWithReadAction
|
* @see analyzeWithReadAction
|
||||||
*/
|
*/
|
||||||
public inline fun <R> analyze(
|
public inline fun <R> analyze(
|
||||||
@@ -38,14 +38,24 @@ public inline fun <R> analyze(
|
|||||||
.analyse(useSiteKtElement, nonDefaultLifetimeTokenFactory, action)
|
.analyse(useSiteKtElement, nonDefaultLifetimeTokenFactory, action)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute given [action] in [KtAnalysisSession] context
|
||||||
|
* Uses [useSiteKtModule] as use-site module, i.e, the module from which perspective the project will be analyzed.
|
||||||
|
*
|
||||||
|
* [nonDefaultLifetimeTokenFactory] represents lifetime and accessibility guaranties
|
||||||
|
* which will be applied to the [org.jetbrains.kotlin.analysis.api.lifetime.KtLifetimeOwner] instances created during code analysis.
|
||||||
|
*
|
||||||
|
* @see KtAnalysisSession
|
||||||
|
* @see KtLifetimeTokenFactory
|
||||||
|
*/
|
||||||
public inline fun <R> analyze(
|
public inline fun <R> analyze(
|
||||||
ktModule: KtModule,
|
useSiteKtModule: KtModule,
|
||||||
nonDefaultLifetimeTokenFactory: KtLifetimeTokenFactory? = null,
|
nonDefaultLifetimeTokenFactory: KtLifetimeTokenFactory? = null,
|
||||||
crossinline action: KtAnalysisSession.() -> R
|
crossinline action: KtAnalysisSession.() -> R
|
||||||
): R {
|
): R {
|
||||||
checkNotNull(ktModule.project)
|
checkNotNull(useSiteKtModule.project)
|
||||||
val sessionProvider = KtAnalysisSessionProvider.getInstance(ktModule.project!!)
|
val sessionProvider = KtAnalysisSessionProvider.getInstance(useSiteKtModule.project!!)
|
||||||
return sessionProvider.analyze(ktModule, nonDefaultLifetimeTokenFactory, action)
|
return sessionProvider.analyze(useSiteKtModule, nonDefaultLifetimeTokenFactory, action)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user