From a793d35e9d0fc67541806c8e241384ece30823ed Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Tue, 6 Dec 2016 15:09:33 +0100 Subject: [PATCH] Fix #16660 --- .../parts/preferences/browser/preferencesService.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/parts/preferences/browser/preferencesService.ts b/src/vs/workbench/parts/preferences/browser/preferencesService.ts index 7a4c374cd27..1695fe21a24 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesService.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesService.ts @@ -21,6 +21,7 @@ import { IEditorGroupService } from 'vs/workbench/services/group/common/groupSer import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IFileService, IFileOperationResult, FileOperationResult } from 'vs/platform/files/common/files'; import { IMessageService, Severity, IChoiceService } from 'vs/platform/message/common/message'; +import { IExtensionService } from 'vs/platform/extensions/common/extensions'; import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { IEnvironmentService } from 'vs/platform/environment/common/environment'; import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; @@ -64,7 +65,8 @@ export class PreferencesService extends Disposable implements IPreferencesServic @IEnvironmentService private environmentService: IEnvironmentService, @ITelemetryService private telemetryService: ITelemetryService, @ITextModelResolverService private textModelResolverService: ITextModelResolverService, - @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService + @IConfigurationEditingService private configurationEditingService: IConfigurationEditingService, + @IExtensionService private extensionService: IExtensionService ) { super(); this.defaultEditorModels = new Map(); @@ -77,8 +79,9 @@ export class PreferencesService extends Disposable implements IPreferencesServic } if (PreferencesService.DEFAULT_SETTINGS_URI.fsPath === uri.fsPath) { - return this.fetchMostCommonlyUsedSettings() - .then(mostCommonSettings => { + return TPromise.join([this.extensionService.onReady(), this.fetchMostCommonlyUsedSettings()]) + .then(result => { + const mostCommonSettings = result[1]; const model = this.instantiationService.createInstance(DefaultSettingsEditorModel, uri, mostCommonSettings); this.defaultEditorModels.set(uri, model); return model; -- GitLab