Analysis API: recreate analysis session when not found by resolve state
This commit is contained in:
+2
@@ -29,6 +29,8 @@ public class AlwaysAccessibleValidityToken(project: Project) : ValidityToken() {
|
||||
override fun getInaccessibilityReason(): String {
|
||||
error("Getting inaccessibility reason for validity token when it is accessible")
|
||||
}
|
||||
|
||||
override val factory: ValidityTokenFactory = AlwaysAccessibleValidityTokenFactory
|
||||
}
|
||||
|
||||
public object AlwaysAccessibleValidityTokenFactory : ValidityTokenFactory() {
|
||||
|
||||
+3
@@ -52,6 +52,8 @@ public class ReadActionConfinementValidityToken(project: Project) : ValidityToke
|
||||
@HackToForceAllowRunningAnalyzeOnEDT
|
||||
public val allowOnEdt: ThreadLocal<Boolean> = ThreadLocal.withInitial { false }
|
||||
}
|
||||
|
||||
public override val factory: ValidityTokenFactory = ReadActionConfinementValidityTokenFactory
|
||||
}
|
||||
|
||||
public object ReadActionConfinementValidityTokenFactory : ValidityTokenFactory() {
|
||||
@@ -70,6 +72,7 @@ public object ReadActionConfinementValidityTokenFactory : ValidityTokenFactory()
|
||||
private val currentAnalysisContextEnteringCount = ThreadLocal.withInitial { 0 }
|
||||
|
||||
internal fun isInsideAnalysisContext() = currentAnalysisContextEnteringCount.get() > 0
|
||||
|
||||
}
|
||||
|
||||
@RequiresOptIn("All frontend related work should not be allowed to be ran from EDT thread. Only use it as a temporary solution")
|
||||
|
||||
@@ -14,6 +14,8 @@ public abstract class ValidityToken {
|
||||
|
||||
public abstract fun isAccessible(): Boolean
|
||||
public abstract fun getInaccessibilityReason(): String
|
||||
|
||||
public abstract val factory: ValidityTokenFactory
|
||||
}
|
||||
|
||||
public abstract class ValidityTokenFactory {
|
||||
|
||||
Reference in New Issue
Block a user