KotlinScriptConfigurationManager#notifyRootsChanges: run synchronously in tests
Allows to unmute some of the ScriptConfigurationNavigation tests
This commit is contained in:
+9
-2
@@ -95,8 +95,7 @@ class KotlinScriptConfigurationManager(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun notifyRootsChanged() {
|
private fun notifyRootsChanged() {
|
||||||
// TODO: it seems invokeLater leads to inconsistent behaviour (at least in tests)
|
val rootsChangesRunnable = {
|
||||||
ApplicationManager.getApplication().invokeLater {
|
|
||||||
runWriteAction {
|
runWriteAction {
|
||||||
if (project.isDisposed) return@runWriteAction
|
if (project.isDisposed) return@runWriteAction
|
||||||
|
|
||||||
@@ -106,6 +105,14 @@ class KotlinScriptConfigurationManager(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val application = ApplicationManager.getApplication()
|
||||||
|
if (application.isUnitTestMode) {
|
||||||
|
rootsChangesRunnable.invoke()
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
application.invokeLater(rootsChangesRunnable)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getScriptClasspath(file: VirtualFile): List<VirtualFile> = toVfsRoots(
|
fun getScriptClasspath(file: VirtualFile): List<VirtualFile> = toVfsRoots(
|
||||||
|
|||||||
Reference in New Issue
Block a user