提交 d0e7a524 编写于 作者: J Johannes Rieken

add setting

上级 e71d1e88
......@@ -82,7 +82,7 @@ class FormatOnSaveParticipant implements ISaveParticipant {
}
participate(editorModel: ITextFileEditorModel, env: { isAutoSaved: boolean }): TPromise<any> {
if (true || this._configurationService.lookup('files.formatOnSave').value) {
if (this._configurationService.lookup('files.formatOnSave').value) {
const model: IModel = editorModel.textEditorModel;
const editor = this._findEditor(model);
return formatDocument(model, editor);
......
......@@ -212,6 +212,11 @@ configurationRegistry.registerConfiguration({
'default': false,
'description': nls.localize('trimTrailingWhitespace', "When enabled, will trim trailing whitespace when you save a file.")
},
'files.formatOnSave': {
'type': 'boolean',
'default': false,
'description': nls.localize('formatOnSave', "Format a file on save - a matching formatting provider must be available.")
},
'files.autoSave': {
'type': 'string',
'enum': [AutoSaveConfiguration.OFF, AutoSaveConfiguration.AFTER_DELAY, AutoSaveConfiguration.ON_FOCUS_CHANGE, , AutoSaveConfiguration.ON_WINDOW_CHANGE],
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册