[AA] Enable test-specific configuration of write access permissions
- In general, Analysis API tests forbid write access because the Analysis API should not be used from write actions. However, in some cases we might want tests to e.g. modify PSI, which requires write access. This change allows `AnalysisApiTestConfigurator`s to enable write access for the specific test.
This commit is contained in:
committed by
Space Team
parent
6189d68c3c
commit
03a7162f37
+6
-5
@@ -69,14 +69,15 @@ object StandaloneProjectFactory {
|
||||
fun createProjectEnvironment(
|
||||
projectDisposable: Disposable,
|
||||
applicationDisposable: Disposable,
|
||||
unitTestMode: Boolean = false,
|
||||
applicationEnvironmentMode: KotlinCoreApplicationEnvironmentMode,
|
||||
compilerConfiguration: CompilerConfiguration = CompilerConfiguration(),
|
||||
classLoader: ClassLoader = MockProject::class.java.classLoader,
|
||||
): KotlinCoreProjectEnvironment {
|
||||
val applicationEnvironment = if (unitTestMode)
|
||||
KotlinCoreEnvironment.getOrCreateApplicationEnvironmentForTests(applicationDisposable, compilerConfiguration)
|
||||
else
|
||||
KotlinCoreEnvironment.getOrCreateApplicationEnvironmentForProduction(applicationDisposable, compilerConfiguration)
|
||||
val applicationEnvironment = KotlinCoreEnvironment.getOrCreateApplicationEnvironment(
|
||||
applicationDisposable,
|
||||
compilerConfiguration,
|
||||
applicationEnvironmentMode,
|
||||
)
|
||||
|
||||
registerApplicationExtensionPoints(applicationEnvironment, applicationDisposable)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user