Add experimental support for update markdown links on file moves/renames (#157209)

* Add experimental support for update markdown links on file moves/renames

Fixes #148146

This adds a new experimental setting that automatically updates markdown

Note that this needs a new version of the vscode-markdown-languageservice so the build is expected to break for now

* Pick up new LS version
This commit is contained in:
Matt Bierner
2022-08-09 08:31:40 -07:00
committed by GitHub
parent 81e6a02c18
commit 8bf82819fc
10 changed files with 291 additions and 6 deletions

View File

@@ -203,6 +203,15 @@ export async function startServer(connection: Connection) {
return undefined;
}));
connection.onRequest(protocol.getEditForFileRenames, (async (params, token: CancellationToken) => {
try {
return await provider!.getRenameFilesInWorkspaceEdit(params.map(x => ({ oldUri: URI.parse(x.oldUri), newUri: URI.parse(x.newUri) })), token);
} catch (e) {
console.error(e.stack);
}
return undefined;
}));
documents.listen(connection);
notebooks.listen(connection);
connection.listen();