提交 e0b00623 编写于 作者: B Benjamin Pasero

misleading wording of "files.preventSaveConflicts" setting (fix #89510)

上级 24a0699f
......@@ -804,7 +804,7 @@ export interface IFilesConfiguration {
eol: string;
enableTrash: boolean;
hotExit: string;
preventSaveConflicts: boolean;
saveConflictResolution: 'askUser' | 'overwriteFileOnDisk';
};
}
......
......@@ -332,7 +332,7 @@ class ConfigureSaveConflictAction extends Action {
}
run(): Promise<any> {
this.preferencesService.openSettings(undefined, 'files.preventSaveConflicts');
this.preferencesService.openSettings(undefined, 'files.saveConflictResolution');
return Promise.resolve(true);
}
......
......@@ -322,10 +322,18 @@ configurationRegistry.registerConfiguration({
'markdownDescription': nls.localize('maxMemoryForLargeFilesMB', "Controls the memory available to VS Code after restart when trying to open large files. Same effect as specifying `--max-memory=NEWSIZE` on the command line."),
included: platform.isNative
},
'files.preventSaveConflicts': {
'type': 'boolean',
'description': nls.localize('files.preventSaveConflicts', "When enabled, will prevent to save a file that has been changed since it was last edited. Instead, a diff editor is provided to compare the changes and accept or revert them. This setting should only be disabled if you frequently encounter save conflict errors and may result in data loss if used without caution."),
'default': true,
'files.saveConflictResolution': {
'type': 'string',
'enum': [
'askUser',
'overwriteFileOnDisk'
],
'enumDescriptions': [
nls.localize('askUser', "Will refuse to save and ask for resolving the save conflict manually."),
nls.localize('overwriteFileOnDisk', "Will resolve the save conflict by overwriting the file on disk with the changes in the editor.")
],
'description': nls.localize('files.saveConflictResolution', "A save conflict can occur when a file is saved to disk that was changed by another program in the meantime. To prevent data loss, the user is asked to compare the changes in the editor with the version on disk. This setting should only be changed if you frequently encounter save conflict errors and may result in data loss if used without caution."),
'default': 'askUser',
'scope': ConfigurationScope.LANGUAGE_OVERRIDABLE
},
'files.simpleDialog.enable': {
......
......@@ -211,7 +211,7 @@ export class FilesConfigurationService extends Disposable implements IFilesConfi
}
preventSaveConflicts(resource: URI, language: string): boolean {
return this.configurationService.getValue('files.preventSaveConflicts', { resource, overrideIdentifier: language });
return this.configurationService.getValue('files.saveConflictResolution', { resource, overrideIdentifier: language }) !== 'overwriteFileOnDisk';
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册