[AA] Document analyzeInDependedAnalysisSession and related classes
This commit is contained in:
committed by
Space Team
parent
ed13d6b3a4
commit
2db8f31966
@@ -73,6 +73,12 @@ public abstract class KtAnalysisSession(final override val token: KtLifetimeToke
|
||||
|
||||
override val analysisSession: KtAnalysisSession get() = this
|
||||
|
||||
/**
|
||||
* Creates a new [KtAnalysisSession] which depends on this analysis session, but additionally provides its own symbols derived from
|
||||
* analyzing [elementToReanalyze].
|
||||
*
|
||||
* @see analyzeInDependedAnalysisSession
|
||||
*/
|
||||
public abstract fun createContextDependentCopy(originalKtFile: KtFile, elementToReanalyze: KtElement): KtAnalysisSession
|
||||
|
||||
internal val smartCastProvider: KtSmartCastProvider get() = smartCastProviderImpl
|
||||
|
||||
@@ -43,11 +43,18 @@ public inline fun <R> analyze(
|
||||
return sessionProvider.analyze(useSiteKtModule, action)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Executes the given [action] in the context of a [KtAnalysisSession] that depends on an original analysis session determined by
|
||||
* [originalFile]. In addition to the symbols provided by the original analysis session, the dependent analysis session provides its own
|
||||
* symbols derived from analyzing [elementToReanalyze]. This allows analyzing some new or copied (and modified) element in the larger
|
||||
* context of the original analysis session.
|
||||
*
|
||||
* @see KtAnalysisSession.createContextDependentCopy
|
||||
*/
|
||||
public inline fun <R> analyzeInDependedAnalysisSession(
|
||||
originalFile: KtFile,
|
||||
elementToReanalyze: KtElement,
|
||||
action: KtAnalysisSession.() -> R
|
||||
): R =
|
||||
KtAnalysisSessionProvider.getInstance(originalFile.project)
|
||||
.analyseInDependedAnalysisSession(originalFile, elementToReanalyze, action)
|
||||
.analyseInDependedAnalysisSession(originalFile, elementToReanalyze, action)
|
||||
|
||||
Reference in New Issue
Block a user