@@ -97,6 +97,10 @@ export class SettingsUIManager {
97
97
languageServerManager : LanguageServerManager ;
98
98
console : ILSPLogConsole ;
99
99
trans : TranslationBundle ;
100
+ /**
101
+ * Promise resolved when JupyterLab splash screen disappears.
102
+ */
103
+ restored : Promise < void > ;
100
104
}
101
105
) {
102
106
this . _defaults = { } ;
@@ -357,11 +361,14 @@ export class SettingsUIManager {
357
361
plugin : ISettingRegistry . IPlugin ,
358
362
schema : ISettingRegistry . ISchema
359
363
) {
360
- // do not re-validate if neither schema, nor user settings changed
364
+ // Ensure the subsequent code runs asynchronously; also reduce the CPU load on startup.
365
+ await this . options . restored ;
366
+
367
+ // Do not re-validate if neither schema, nor user settings changed
361
368
if ( this . _wasPreviouslyValidated ( plugin , schema ) ) {
362
369
return ;
363
370
}
364
- // test if we can apply the schema without causing validation error
371
+ // Test if we can apply the schema without causing validation error
365
372
// (is the configuration held by the user compatible with the schema?)
366
373
this . _validationAttempt += 1 ;
367
374
// the validator will parse raw plugin data into this object;
@@ -370,7 +377,7 @@ export class SettingsUIManager {
370
377
const validationErrors =
371
378
this . options . settingRegistry . validator . validateData (
372
379
{
373
- // the plugin schema is cached so we have to provide a dummy ID;
380
+ // The plugin schema is cached so we have to provide a dummy ID;
374
381
// can be simplified once https://github.com/jupyterlab/jupyterlab/issues/12978 is fixed.
375
382
id : `lsp-validation-attempt-${ this . _validationAttempt } ` ,
376
383
raw : plugin . raw ,
@@ -412,6 +419,10 @@ export class SettingsUIManager {
412
419
}
413
420
414
421
private async _warnConflicts ( conflicts : SettingsMergeConflicts ) {
422
+ // Ensure the subsequent code runs asynchronously, and delay
423
+ // showing the dialog until the splash screen disappeared.
424
+ await this . options . restored ;
425
+
415
426
showDialog ( {
416
427
body : renderCollapseConflicts ( {
417
428
conflicts : conflicts ,
0 commit comments