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

rename auto save options to shorter words

上级 cda49edf
......@@ -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
......@@ -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;
......
......@@ -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.")
}
}
});
......
......@@ -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
}
}
......
......@@ -289,8 +289,8 @@ export interface IResult {
}
export interface IAutoSaveConfiguration {
autoSaveAfterDelay: number;
autoSaveAfterFocusChange: boolean;
autoSaveDelay: number;
autoSaveFocusChange: boolean;
}
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.
先完成此消息的编辑!
想要评论请 注册