Skip to content

Commit 940abc9

Browse files
authored
Fix workspace edit format for update md paths on move (microsoft#158965)
Unblocks testing microsoft#158416
1 parent 6e7b7a3 commit 940abc9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

extensions/markdown-language-features/src/languageFeatures/updatePathsOnRename.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import * as path from 'path';
77
import * as picomatch from 'picomatch';
88
import * as vscode from 'vscode';
9-
import { BaseLanguageClient } from 'vscode-languageclient';
9+
import { BaseLanguageClient, TextDocumentEdit } from 'vscode-languageclient';
1010
import * as nls from 'vscode-nls';
1111
import { getEditForFileRenames } from '../protocol';
1212
import { Delayer } from '../util/async';
@@ -206,13 +206,13 @@ class UpdateLinksOnFileRenameHandler extends Disposable {
206206
token: vscode.CancellationToken,
207207
): Promise<boolean> {
208208
const edit = await this.client.sendRequest(getEditForFileRenames, [{ oldUri: oldUri.toString(), newUri: newUri.toString() }], token);
209-
if (!edit.changes) {
209+
if (!edit.documentChanges?.length) {
210210
return false;
211211
}
212212

213-
for (const [path, edits] of Object.entries(edit.changes)) {
214-
const uri = vscode.Uri.parse(path);
215-
for (const edit of edits) {
213+
for (const change of edit.documentChanges as TextDocumentEdit[]) {
214+
const uri = vscode.Uri.parse(change.textDocument.uri);
215+
for (const edit of change.edits) {
216216
workspaceEdit.replace(uri, convertRange(edit.range), edit.newText);
217217
}
218218
}

0 commit comments

Comments
 (0)