diff --git a/src/vs/platform/files/common/files.ts b/src/vs/platform/files/common/files.ts index 1ff68f90cf811deb9b02eeeac6399b0462df8189..01609c631f67f3698645036ce725c3a9ba276781 100644 --- a/src/vs/platform/files/common/files.ts +++ b/src/vs/platform/files/common/files.ts @@ -417,7 +417,7 @@ export interface IFilesConfiguration { exclude: glob.IExpression; encoding: string; trimTrailingWhitespace: boolean; - autoSaveAfterDelay: number; - autoSaveAfterFocusChange: boolean; + autoSaveDelay: number; + autoSaveFocusChange: boolean; }; } \ No newline at end of file diff --git a/src/vs/workbench/parts/files/browser/editors/textFileEditorModel.ts b/src/vs/workbench/parts/files/browser/editors/textFileEditorModel.ts index 23908d482b467ad39c37826c827d7d7e818aa476..d8a4641d93e9672db6df712817aed0d1762a0338 100644 --- a/src/vs/workbench/parts/files/browser/editors/textFileEditorModel.ts +++ b/src/vs/workbench/parts/files/browser/editors/textFileEditorModel.ts @@ -136,8 +136,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements IEncodin } public updateAutoSaveConfiguration(config: IAutoSaveConfiguration): void { - if (typeof config.autoSaveAfterDelay === 'number' && config.autoSaveAfterDelay > 0) { - this.autoSaveAfterMillies = config.autoSaveAfterDelay * 1000; + if (typeof config.autoSaveDelay === 'number' && config.autoSaveDelay > 0) { + this.autoSaveAfterMillies = config.autoSaveDelay * 1000; this.autoSaveAfterMilliesEnabled = true; } else { this.autoSaveAfterMillies = void 0; diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index ef4898eddecea53609c0643ea29f0ecd39e91622..8513db99670ec80d6438d0dd60ee7019418db3a5 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -219,15 +219,15 @@ configurationRegistry.registerConfiguration({ 'default': false, 'description': nls.localize('trimTrailingWhitespace', "When enabled, will trim trailing whitespace when you save a file.") }, - 'files.autoSaveAfterDelay': { + 'files.autoSaveDelay': { 'type': 'number', 'default': 0, - 'description': nls.localize('autoSaveAfterDelay', "When set to a positive number, will automatically save dirty editors after configured seconds.") + 'description': nls.localize('autoSaveDelay', "When set to a positive number, will automatically save dirty editors after configured seconds.") }, - 'files.autoSaveAfterFocusChange': { + 'files.autoSaveFocusChange': { 'type': 'boolean', 'default': false, - 'description': nls.localize('autoSaveAfterFocusChange', "When enabled, will automatically save dirty editors when they lose focus or are closed.") + 'description': nls.localize('autoSaveFocusChange', "When enabled, will automatically save dirty editors when they lose focus or are closed.") } } }); diff --git a/src/vs/workbench/parts/files/browser/textFileServices.ts b/src/vs/workbench/parts/files/browser/textFileServices.ts index 20b8a56ec9c6f000e983a80c951fc5cb54f52848..3276d28340570484a7f237e7f5945a745e38df99 100644 --- a/src/vs/workbench/parts/files/browser/textFileServices.ts +++ b/src/vs/workbench/parts/files/browser/textFileServices.ts @@ -90,8 +90,8 @@ export abstract class TextFileService implements ITextFileService { private onConfigurationChange(configuration: IFilesConfiguration): void { const wasAutoSaveEnabled = this.isAutoSaveEnabled(); - this.configuredAutoSaveDelay = configuration && configuration.files && configuration.files.autoSaveAfterDelay; - this.configuredAutoSaveOnFocusChange = configuration && configuration.files && configuration.files.autoSaveAfterFocusChange; + this.configuredAutoSaveDelay = configuration && configuration.files && configuration.files.autoSaveDelay; + this.configuredAutoSaveOnFocusChange = configuration && configuration.files && configuration.files.autoSaveFocusChange; const autoSaveConfig = this.getAutoSaveConfiguration(); CACHE.getAll().forEach((model) => model.updateAutoSaveConfiguration(autoSaveConfig)); @@ -228,8 +228,8 @@ export abstract class TextFileService implements ITextFileService { public getAutoSaveConfiguration(): IAutoSaveConfiguration { return { - autoSaveAfterDelay: this.configuredAutoSaveDelay && this.configuredAutoSaveDelay > 0 ? this.configuredAutoSaveDelay : void 0, - autoSaveAfterFocusChange: this.configuredAutoSaveOnFocusChange + autoSaveDelay: this.configuredAutoSaveDelay && this.configuredAutoSaveDelay > 0 ? this.configuredAutoSaveDelay : void 0, + autoSaveFocusChange: this.configuredAutoSaveOnFocusChange } } diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/parts/files/common/files.ts index c61665b8cba1bf747d7e84d63492a04da55858d6..88d304ba37a5e39eda1ca7348299837cc1ad1ccf 100644 --- a/src/vs/workbench/parts/files/common/files.ts +++ b/src/vs/workbench/parts/files/common/files.ts @@ -289,8 +289,8 @@ export interface IResult { } export interface IAutoSaveConfiguration { - autoSaveAfterDelay: number; - autoSaveAfterFocusChange: boolean; + autoSaveDelay: number; + autoSaveFocusChange: boolean; } export var ITextFileService = createDecorator(TEXT_FILE_SERVICE_ID);