mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-29 13:03:42 +01:00
fix format on save problem that occurs when a provider returns no edits
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user