diff --git a/src/vs/editor/browser/standalone/simpleServices.ts b/src/vs/editor/browser/standalone/simpleServices.ts index 2058553626b..872c7483d8f 100644 --- a/src/vs/editor/browser/standalone/simpleServices.ts +++ b/src/vs/editor/browser/standalone/simpleServices.ts @@ -294,7 +294,7 @@ export class SimpleConfigurationService implements IConfigurationService { return Object.create(null); } - public loadConfiguration(section?: string): TPromise { + public reloadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration(section)); } } diff --git a/src/vs/platform/configuration/common/configuration.ts b/src/vs/platform/configuration/common/configuration.ts index 3e8ab7da76b..dcbb8f80acd 100644 --- a/src/vs/platform/configuration/common/configuration.ts +++ b/src/vs/platform/configuration/common/configuration.ts @@ -22,7 +22,7 @@ export interface IConfigurationService { * Similar to #getConfiguration() but ensures that the latest configuration * from disk is fetched. */ - loadConfiguration(section?: string): TPromise; + reloadConfiguration(section?: string): TPromise; /** * Event that fires when the configuration changes. diff --git a/src/vs/platform/configuration/node/configurationService.ts b/src/vs/platform/configuration/node/configurationService.ts index b91dac45c86..49aaa0983f7 100644 --- a/src/vs/platform/configuration/node/configurationService.ts +++ b/src/vs/platform/configuration/node/configurationService.ts @@ -52,7 +52,7 @@ export class ConfigurationService implements IConfigurationService, IDisposab return this._onDidUpdateConfiguration.event; } - public loadConfiguration(section?: string): TPromise { + public reloadConfiguration(section?: string): TPromise { return new TPromise(c => { this.rawConfig.reload(() => { this.cache = void 0; // reset our caches diff --git a/src/vs/platform/configuration/test/node/configurationService.test.ts b/src/vs/platform/configuration/test/node/configurationService.test.ts index 662ffa1d2fe..00ce734eabd 100644 --- a/src/vs/platform/configuration/test/node/configurationService.test.ts +++ b/src/vs/platform/configuration/test/node/configurationService.test.ts @@ -104,7 +104,7 @@ suite('ConfigurationService - Node', () => { service.dispose(); }); - test('loadConfiguration', (done: () => void) => { + test('reloadConfiguration', (done: () => void) => { testFile((testFile, cleanUp) => { fs.writeFileSync(testFile, '{ "foo": "bar" }'); @@ -122,7 +122,7 @@ suite('ConfigurationService - Node', () => { assert.equal(config.foo, 'bar'); // force a reload to get latest - service.loadConfiguration<{ foo: string }>().then(config => { + service.reloadConfiguration<{ foo: string }>().then(config => { assert.ok(config); assert.equal(config.foo, 'changed'); @@ -138,7 +138,7 @@ suite('ConfigurationService - Node', () => { fs.writeFileSync(testFile, '{ "workbench.editor.tabs": true }'); const service = new ConfigurationService(new SettingsTestEnvironmentService(parseArgs(process.argv), process.execPath, testFile)); - service.loadConfiguration().then(() => { // ensure loaded + service.reloadConfiguration().then(() => { // ensure loaded service.onDidUpdateConfiguration(event => { const config = <{ workbench: { editor: { tabs: boolean } } }>event.config; @@ -196,7 +196,7 @@ suite('ConfigurationService - Node', () => { fs.writeFileSync(testFile, '{ "configuration.service.testSetting": "isChanged" }'); - service.loadConfiguration().then(() => { + service.reloadConfiguration().then(() => { let setting = service.getConfiguration(); assert.ok(setting); diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 0f45c0bc01a..bee0b01e3fa 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -475,6 +475,7 @@ export interface IFilesConfiguration { autoSave: string; autoSaveDelay: number; eol: string; + iconTheme: string; }; } diff --git a/src/vs/platform/telemetry/test/node/telemetryService.test.ts b/src/vs/platform/telemetry/test/node/telemetryService.test.ts index 924619d039f..98e262648b2 100644 --- a/src/vs/platform/telemetry/test/node/telemetryService.test.ts +++ b/src/vs/platform/telemetry/test/node/telemetryService.test.ts @@ -651,7 +651,7 @@ suite('TelemetryService', () => { enableTelemetry }; }, - loadConfiguration() { + reloadConfiguration() { return TPromise.as(this.getConfiguration()); }, onDidUpdateConfiguration: emitter.event diff --git a/src/vs/test/utils/servicesTestUtils.ts b/src/vs/test/utils/servicesTestUtils.ts index 1a6ec77a9c3..520a7a71290 100644 --- a/src/vs/test/utils/servicesTestUtils.ts +++ b/src/vs/test/utils/servicesTestUtils.ts @@ -543,7 +543,7 @@ export class TestConfigurationService extends EventEmitter.EventEmitter implemen private configuration = Object.create(null); - public loadConfiguration(section?: string): TPromise { + public reloadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 5969e25226f..a7a2c033e03 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -526,7 +526,7 @@ export class DebugService implements debug.IDebugService { this.removeReplExpressions(); return this.textFileService.saveAll() // make sure all dirty files are saved - .then(() => this.configurationService.loadConfiguration() // make sure configuration is up to date + .then(() => this.configurationService.reloadConfiguration() // make sure configuration is up to date .then(() => this.extensionService.onReady() .then(() => this.configurationManager.setConfiguration(configuration || this.configurationManager.configurationName) .then(() => this.configurationManager.resolveInteractiveVariables()) diff --git a/src/vs/workbench/parts/files/browser/explorerViewlet.ts b/src/vs/workbench/parts/files/browser/explorerViewlet.ts index 92d2c8f9b16..f610a605d4b 100644 --- a/src/vs/workbench/parts/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/browser/explorerViewlet.ts @@ -75,7 +75,10 @@ export class ExplorerViewlet extends Viewlet { super.create(parent); this.viewletContainer = parent.div().addClass('explorer-viewlet'); - return this.configurationService.loadConfiguration().then((config: IFilesConfiguration) => this.onConfigurationUpdated(config)); + + const settings = this.configurationService.getConfiguration(); + + return this.onConfigurationUpdated(settings); } public getActions(): IAction[] { diff --git a/src/vs/workbench/parts/lib/test/node/configVariables.test.ts b/src/vs/workbench/parts/lib/test/node/configVariables.test.ts index a988c3bb31b..b67ae977b57 100644 --- a/src/vs/workbench/parts/lib/test/node/configVariables.test.ts +++ b/src/vs/workbench/parts/lib/test/node/configVariables.test.ts @@ -125,7 +125,7 @@ class MockConfigurationService implements IConfigurationService { public _serviceBrand: any; public serviceId = IConfigurationService; public constructor(private configuration: any = {}) { } - public loadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } + public reloadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } public getConfiguration(): any { return this.configuration; } public onDidUpdateConfiguration() { return { dispose() { } }; } } \ No newline at end of file diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index 219e6901d7a..49185143e28 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -774,7 +774,7 @@ class TaskService extends EventEmitter implements ITaskService { private executeTarget(fn: (taskSystem: ITaskSystem) => ITaskRunResult): TPromise { return this.textFileService.saveAll().then((value) => { // make sure all dirty files are saved - return this.configurationService.loadConfiguration().then(() => { // make sure configuration is up to date + return this.configurationService.reloadConfiguration().then(() => { // make sure configuration is up to date return this.taskSystemPromise. then((taskSystem) => { return taskSystem.isActive().then((active) => { diff --git a/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts b/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts index a670fa37cf3..74e7e9ff18c 100644 --- a/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts +++ b/src/vs/workbench/parts/terminal/test/terminalConfigHelper.test.ts @@ -17,7 +17,7 @@ import {DefaultConfig} from 'vs/editor/common/config/defaultConfig'; class MockConfigurationService implements IConfigurationService { public _serviceBrand: any; public constructor(private configuration: any = {}) {} - public loadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } + public reloadConfiguration(section?: string): TPromise { return TPromise.as(this.getConfiguration()); } public getConfiguration(): any { return this.configuration; } public onDidUpdateConfiguration() { return { dispose() { } }; } } diff --git a/src/vs/workbench/services/configuration/node/configurationService.ts b/src/vs/workbench/services/configuration/node/configurationService.ts index d7a15136699..174b84cf15e 100644 --- a/src/vs/workbench/services/configuration/node/configurationService.ts +++ b/src/vs/workbench/services/configuration/node/configurationService.ts @@ -116,7 +116,7 @@ export class ConfigurationService implements IWorkbenchConfigurationService, IDi return result; } - public loadConfiguration(section?: string): TPromise { + public reloadConfiguration(section?: string): TPromise { // Reset caches to ensure we are hitting the disk this.bulkFetchFromWorkspacePromise = null; diff --git a/src/vs/workbench/services/themes/electron-browser/themeService.ts b/src/vs/workbench/services/themes/electron-browser/themeService.ts index 5099c16cd60..1ef39e3d3b0 100644 --- a/src/vs/workbench/services/themes/electron-browser/themeService.ts +++ b/src/vs/workbench/services/themes/electron-browser/themeService.ts @@ -19,6 +19,7 @@ import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry'; import {IConfigurationService} from 'vs/platform/configuration/common/configuration'; import {Registry} from 'vs/platform/platform'; import {IConfigurationRegistry, Extensions} from 'vs/platform/configuration/common/configurationRegistry'; +import {IFilesConfiguration} from 'vs/platform/files/common/files'; import {$} from 'vs/base/browser/builder'; import Event, {Emitter} from 'vs/base/common/event'; @@ -190,12 +191,11 @@ export class ThemeService implements IThemeService { } }); - configurationService.loadConfiguration('files').then((settings: any) => { - let iconTheme = settings && settings.iconTheme; - if (iconTheme) { - this.setFileIcons(iconTheme); - } - }); + const settings = configurationService.getConfiguration(); + let iconTheme = settings && settings.files && settings.files.iconTheme; + if (iconTheme) { + this.setFileIcons(iconTheme); + } configurationService.onDidUpdateConfiguration(e => { let filesConfig = e.config.files;