mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
Fix workspace edit format for update md paths on move (#158965)
Unblocks testing #158416
This commit is contained in:
parent
6e7b7a33e6
commit
940abc9c11
|
@ -6,7 +6,7 @@
|
|||
import * as path from 'path';
|
||||
import * as picomatch from 'picomatch';
|
||||
import * as vscode from 'vscode';
|
||||
import { BaseLanguageClient } from 'vscode-languageclient';
|
||||
import { BaseLanguageClient, TextDocumentEdit } from 'vscode-languageclient';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { getEditForFileRenames } from '../protocol';
|
||||
import { Delayer } from '../util/async';
|
||||
|
@ -206,13 +206,13 @@ class UpdateLinksOnFileRenameHandler extends Disposable {
|
|||
token: vscode.CancellationToken,
|
||||
): Promise<boolean> {
|
||||
const edit = await this.client.sendRequest(getEditForFileRenames, [{ oldUri: oldUri.toString(), newUri: newUri.toString() }], token);
|
||||
if (!edit.changes) {
|
||||
if (!edit.documentChanges?.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const [path, edits] of Object.entries(edit.changes)) {
|
||||
const uri = vscode.Uri.parse(path);
|
||||
for (const edit of edits) {
|
||||
for (const change of edit.documentChanges as TextDocumentEdit[]) {
|
||||
const uri = vscode.Uri.parse(change.textDocument.uri);
|
||||
for (const edit of change.edits) {
|
||||
workspaceEdit.replace(uri, convertRange(edit.range), edit.newText);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue