diff --git a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts index 5d0a02c34e3b605f0c91d3061091b4d6aa484205..07a61e0f3b8dc794f5706294ad756e31a694a424 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadSaveParticipant.ts @@ -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);