5
5
} from '@theia/core/shared/inversify' ;
6
6
import URI from '@theia/core/lib/common/uri' ;
7
7
import { Emitter } from '@theia/core/lib/common/event' ;
8
- import { Deferred , timeout } from '@theia/core/lib/common/promise-util' ;
8
+ import { Deferred } from '@theia/core/lib/common/promise-util' ;
9
9
import { deepClone } from '@theia/core/lib/common/objects' ;
10
10
import { FileService } from '@theia/filesystem/lib/browser/file-service' ;
11
11
import { ThemeService } from '@theia/core/lib/browser/theming' ;
@@ -25,6 +25,7 @@ import {
25
25
LanguageInfo ,
26
26
} from '@theia/core/lib/common/i18n/localization' ;
27
27
import { ElectronCommands } from '@theia/core/lib/electron-browser/menu/electron-menu-contribution' ;
28
+ import { ArduinoThemes } from '../../theia/core/theming' ;
28
29
29
30
export const EDITOR_SETTING = 'editor' ;
30
31
export const FONT_SIZE_SETTING = `${ EDITOR_SETTING } .fontSize` ;
@@ -142,7 +143,7 @@ export class SettingsService {
142
143
this . preferenceService . get < number > ( FONT_SIZE_SETTING , 12 ) ,
143
144
this . preferenceService . get < string > (
144
145
'workbench.colorTheme' ,
145
- 'arduino-theme'
146
+ ArduinoThemes . Default . id
146
147
) ,
147
148
this . preferenceService . get < Settings . AutoSave > (
148
149
AUTO_SAVE_SETTING ,
@@ -246,7 +247,6 @@ export class SettingsService {
246
247
247
248
private async savePreference ( name : string , value : unknown ) : Promise < void > {
248
249
await this . preferenceService . set ( name , value , PreferenceScope . User ) ;
249
- await timeout ( 5 ) ;
250
250
}
251
251
252
252
async save ( ) : Promise < string | true > {
@@ -277,19 +277,21 @@ export class SettingsService {
277
277
( config as any ) . network = network ;
278
278
( config as any ) . locale = currentLanguage ;
279
279
280
- await this . savePreference ( 'editor.fontSize' , editorFontSize ) ;
281
- await this . savePreference ( 'workbench.colorTheme' , themeId ) ;
282
- await this . savePreference ( AUTO_SAVE_SETTING , autoSave ) ;
283
- await this . savePreference ( 'editor.quickSuggestions' , quickSuggestions ) ;
284
- await this . savePreference ( AUTO_SCALE_SETTING , autoScaleInterface ) ;
285
- await this . savePreference ( ZOOM_LEVEL_SETTING , interfaceScale ) ;
286
- await this . savePreference ( ZOOM_LEVEL_SETTING , interfaceScale ) ;
287
- await this . savePreference ( COMPILE_VERBOSE_SETTING , verboseOnCompile ) ;
288
- await this . savePreference ( COMPILE_WARNINGS_SETTING , compilerWarnings ) ;
289
- await this . savePreference ( UPLOAD_VERBOSE_SETTING , verboseOnUpload ) ;
290
- await this . savePreference ( UPLOAD_VERIFY_SETTING , verifyAfterUpload ) ;
291
- await this . savePreference ( SHOW_ALL_FILES_SETTING , sketchbookShowAllFiles ) ;
292
- await this . configService . setConfiguration ( config ) ;
280
+ await Promise . all ( [
281
+ this . savePreference ( 'editor.fontSize' , editorFontSize ) ,
282
+ this . savePreference ( 'workbench.colorTheme' , themeId ) ,
283
+ this . savePreference ( AUTO_SAVE_SETTING , autoSave ) ,
284
+ this . savePreference ( 'editor.quickSuggestions' , quickSuggestions ) ,
285
+ this . savePreference ( AUTO_SCALE_SETTING , autoScaleInterface ) ,
286
+ this . savePreference ( ZOOM_LEVEL_SETTING , interfaceScale ) ,
287
+ this . savePreference ( ZOOM_LEVEL_SETTING , interfaceScale ) ,
288
+ this . savePreference ( COMPILE_VERBOSE_SETTING , verboseOnCompile ) ,
289
+ this . savePreference ( COMPILE_WARNINGS_SETTING , compilerWarnings ) ,
290
+ this . savePreference ( UPLOAD_VERBOSE_SETTING , verboseOnUpload ) ,
291
+ this . savePreference ( UPLOAD_VERIFY_SETTING , verifyAfterUpload ) ,
292
+ this . savePreference ( SHOW_ALL_FILES_SETTING , sketchbookShowAllFiles ) ,
293
+ this . configService . setConfiguration ( config ) ,
294
+ ] ) ;
293
295
this . onDidChangeEmitter . fire ( this . _settings ) ;
294
296
295
297
// after saving all the settings, if we need to change the language we need to perform a reload
0 commit comments