init LafManager before calling application starter

GitOrigin-RevId: 9c3340023b0ee7fb9cdc1c013adace8e671b950e
This commit is contained in:
Vladimir Krivosheev
2023-07-31 21:18:36 +00:00
committed by intellij-monorepo-bot
parent 90fa33fb11
commit 6348100bca
@@ -140,11 +140,11 @@ private suspend fun initServiceContainer(app: ApplicationImpl, pluginSetDeferred
}
private suspend fun preInitApp(app: ApplicationImpl,
asyncScope: CoroutineScope,
log: Logger,
initLafJob: Job,
appRegisteredJob: Job,
euaTaskDeferred: Deferred<(suspend () -> Boolean)?>?) {
asyncScope: CoroutineScope,
log: Logger,
initLafJob: Job,
appRegisteredJob: Job,
euaTaskDeferred: Deferred<(suspend () -> Boolean)?>?) {
coroutineScope {
launch(CoroutineName("critical services preloading")) {
preloadCriticalServices(app = app, asyncScope = asyncScope, appRegistered = appRegisteredJob, initLafJob = initLafJob)
@@ -176,18 +176,8 @@ private suspend fun preInitApp(app: ApplicationImpl,
euaTaskDeferred?.await()?.invoke()
asyncScope.launch {
if (!app.isHeadlessEnvironment) {
launch(CoroutineName("icons preloading") + Dispatchers.IO) {
AsyncProcessIcon.createBig(this)
AsyncProcessIcon(this)
AnimatedIcon.Blinking(AllIcons.Ide.FatalError)
AnimatedIcon.FS()
}
}
launch {
coroutineScope {
loadIconMapping?.join()
launch {
// used by LafManager
app.serviceAsync<UISettings>()
@@ -197,16 +187,28 @@ private suspend fun preInitApp(app: ApplicationImpl,
}
}
loadIconMapping?.join()
span("laf initialization", RawSwingDispatcher) {
app.serviceAsync<LafManager>()
}
if (!app.isHeadlessEnvironment) {
// preload only when LafManager is ready
launch {
asyncScope.launch {
app.serviceAsync<EditorColorsManager>()
}
}
}
if (!app.isHeadlessEnvironment) {
asyncScope.launch(CoroutineName("icons preloading") + Dispatchers.IO) {
AsyncProcessIcon.createBig(this)
AsyncProcessIcon(this)
AnimatedIcon.Blinking(AllIcons.Ide.FatalError)
AnimatedIcon.FS()
}
}
}
}