提交 9b3308e1 编写于 作者: B Benjamin Pasero

rename auto save options to shorter words

上级 cda49edf
...@@ -417,7 +417,7 @@ export interface IFilesConfiguration { ...@@ -417,7 +417,7 @@ export interface IFilesConfiguration {
exclude: glob.IExpression; exclude: glob.IExpression;
encoding: string; encoding: string;
trimTrailingWhitespace: boolean; trimTrailingWhitespace: boolean;
autoSaveAfterDelay: number; autoSaveDelay: number;
autoSaveAfterFocusChange: boolean; autoSaveFocusChange: boolean;
}; };
} }
\ No newline at end of file
...@@ -136,8 +136,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements IEncodin ...@@ -136,8 +136,8 @@ export class TextFileEditorModel extends BaseTextEditorModel implements IEncodin
} }
public updateAutoSaveConfiguration(config: IAutoSaveConfiguration): void { public updateAutoSaveConfiguration(config: IAutoSaveConfiguration): void {
if (typeof config.autoSaveAfterDelay === 'number' && config.autoSaveAfterDelay > 0) { if (typeof config.autoSaveDelay === 'number' && config.autoSaveDelay > 0) {
this.autoSaveAfterMillies = config.autoSaveAfterDelay * 1000; this.autoSaveAfterMillies = config.autoSaveDelay * 1000;
this.autoSaveAfterMilliesEnabled = true; this.autoSaveAfterMilliesEnabled = true;
} else { } else {
this.autoSaveAfterMillies = void 0; this.autoSaveAfterMillies = void 0;
......
...@@ -219,15 +219,15 @@ configurationRegistry.registerConfiguration({ ...@@ -219,15 +219,15 @@ configurationRegistry.registerConfiguration({
'default': false, 'default': false,
'description': nls.localize('trimTrailingWhitespace', "When enabled, will trim trailing whitespace when you save a file.") 'description': nls.localize('trimTrailingWhitespace', "When enabled, will trim trailing whitespace when you save a file.")
}, },
'files.autoSaveAfterDelay': { 'files.autoSaveDelay': {
'type': 'number', 'type': 'number',
'default': 0, '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', 'type': 'boolean',
'default': false, '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.")
} }
} }
}); });
......
...@@ -90,8 +90,8 @@ export abstract class TextFileService implements ITextFileService { ...@@ -90,8 +90,8 @@ export abstract class TextFileService implements ITextFileService {
private onConfigurationChange(configuration: IFilesConfiguration): void { private onConfigurationChange(configuration: IFilesConfiguration): void {
const wasAutoSaveEnabled = this.isAutoSaveEnabled(); const wasAutoSaveEnabled = this.isAutoSaveEnabled();
this.configuredAutoSaveDelay = configuration && configuration.files && configuration.files.autoSaveAfterDelay; this.configuredAutoSaveDelay = configuration && configuration.files && configuration.files.autoSaveDelay;
this.configuredAutoSaveOnFocusChange = configuration && configuration.files && configuration.files.autoSaveAfterFocusChange; this.configuredAutoSaveOnFocusChange = configuration && configuration.files && configuration.files.autoSaveFocusChange;
const autoSaveConfig = this.getAutoSaveConfiguration(); const autoSaveConfig = this.getAutoSaveConfiguration();
CACHE.getAll().forEach((model) => model.updateAutoSaveConfiguration(autoSaveConfig)); CACHE.getAll().forEach((model) => model.updateAutoSaveConfiguration(autoSaveConfig));
...@@ -228,8 +228,8 @@ export abstract class TextFileService implements ITextFileService { ...@@ -228,8 +228,8 @@ export abstract class TextFileService implements ITextFileService {
public getAutoSaveConfiguration(): IAutoSaveConfiguration { public getAutoSaveConfiguration(): IAutoSaveConfiguration {
return { return {
autoSaveAfterDelay: this.configuredAutoSaveDelay && this.configuredAutoSaveDelay > 0 ? this.configuredAutoSaveDelay : void 0, autoSaveDelay: this.configuredAutoSaveDelay && this.configuredAutoSaveDelay > 0 ? this.configuredAutoSaveDelay : void 0,
autoSaveAfterFocusChange: this.configuredAutoSaveOnFocusChange autoSaveFocusChange: this.configuredAutoSaveOnFocusChange
} }
} }
......
...@@ -289,8 +289,8 @@ export interface IResult { ...@@ -289,8 +289,8 @@ export interface IResult {
} }
export interface IAutoSaveConfiguration { export interface IAutoSaveConfiguration {
autoSaveAfterDelay: number; autoSaveDelay: number;
autoSaveAfterFocusChange: boolean; autoSaveFocusChange: boolean;
} }
export var ITextFileService = createDecorator<ITextFileService>(TEXT_FILE_SERVICE_ID); export var ITextFileService = createDecorator<ITextFileService>(TEXT_FILE_SERVICE_ID);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册