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

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

上级 a3bede49
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册