fix format on save problem that occurs when a provider returns no edits

This commit is contained in:
Johannes Rieken
2018-01-19 17:56:23 +01:00
parent a3bede4943
commit cb3c8e7e50

View File

@@ -26,6 +26,7 @@ import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerServ
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
import { IProgressService2, ProgressLocation } from 'vs/platform/progress/common/progress';
import { localize } from 'vs/nls';
import { isFalsyOrEmpty } from 'vs/base/common/arrays';
export interface ISaveParticipantParticipant extends ISaveParticipant {
// progressMessage: string;
@@ -208,7 +209,7 @@ class FormatOnSaveParticipant implements ISaveParticipantParticipant {
});
}).then(edits => {
if (edits && versionNow === model.getVersionId()) {
if (!isFalsyOrEmpty(edits) && versionNow === model.getVersionId()) {
const editor = findEditor(model, this._editorService);
if (editor) {
this._editsWithEditor(editor, edits);