Skip to content

Commit 29567d1

Browse files
committed
fix issue with serialization, add todo for hacks
1 parent c7f15a5 commit 29567d1

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

src/vs/workbench/api/common/extHostTypeConverters.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -598,14 +598,21 @@ export namespace WorkspaceEdit {
598598
});
599599

600600
} else if (entry._type === types.FileEditType.Text) {
601+
601602
// text edits
602-
result.edits.push(<extHostProtocol.IWorkspaceTextEditDto>{
603+
const dto = <extHostProtocol.IWorkspaceTextEditDto>{
603604
_type: extHostProtocol.WorkspaceEditType.Text,
604605
resource: entry.uri,
605-
edit: { ...TextEdit.from(entry.edit), insertAsSnippet: allowSnippetTextEdit && entry.edit.newText2 instanceof types.SnippetString },
606+
edit: TextEdit.from(entry.edit),
606607
modelVersionId: !toCreate.has(entry.uri) ? versionInfo?.getTextDocumentVersion(entry.uri) : undefined,
607608
metadata: entry.metadata
608-
});
609+
};
610+
if (allowSnippetTextEdit && entry.edit.newText2 instanceof types.SnippetString) {
611+
dto.edit.insertAsSnippet = true;
612+
dto.edit.text = entry.edit.newText2.value;
613+
}
614+
result.edits.push(dto);
615+
609616
} else if (entry._type === types.FileEditType.Cell) {
610617
result.edits.push(<extHostProtocol.IWorkspaceCellEditDto>{
611618
_type: extHostProtocol.WorkspaceEditType.Cell,

src/vs/workbench/contrib/bulkEdit/browser/bulkTextEdits.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export class BulkTextEdits {
206206
let makeMinimal = false;
207207
if (this._editor?.getModel()?.uri.toString() === ref.object.textEditorModel.uri.toString()) {
208208
task = new EditorEditTask(ref, this._editor);
209-
makeMinimal = true && false;
209+
makeMinimal = true && false; // todo@jrieken HACK
210210
} else {
211211
task = new ModelEditTask(ref);
212212
}

0 commit comments

Comments
 (0)