mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
mapped edits: restore backward compat
This commit is contained in:
@@ -1830,16 +1830,19 @@ class MappedEditsAdapter {
|
|||||||
const uri = URI.revive(resource);
|
const uri = URI.revive(resource);
|
||||||
const doc = this._documents.getDocument(uri);
|
const doc = this._documents.getDocument(uri);
|
||||||
|
|
||||||
|
const usedContext = context.documents.map((docSubArray) =>
|
||||||
|
docSubArray.map((r) => {
|
||||||
|
return {
|
||||||
|
uri: URI.revive(r.uri),
|
||||||
|
version: r.version,
|
||||||
|
ranges: r.ranges.map((range) => typeConvert.Range.to(range)),
|
||||||
|
};
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const ctx = {
|
const ctx = {
|
||||||
documents: context.documents.map((docSubArray) =>
|
documents: usedContext,
|
||||||
docSubArray.map((r) => {
|
selections: usedContext[0]?.[0]?.ranges ?? [] // @ulugbekna: this is a hack for backward compatibility
|
||||||
return {
|
|
||||||
uri: URI.revive(r.uri),
|
|
||||||
version: r.version,
|
|
||||||
ranges: r.ranges.map((range) => typeConvert.Range.to(range)),
|
|
||||||
};
|
|
||||||
})
|
|
||||||
),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const mappedEdits = await this._provider.provideMappedEdits(doc, codeBlocks, ctx, token);
|
const mappedEdits = await this._provider.provideMappedEdits(doc, codeBlocks, ctx, token);
|
||||||
|
|||||||
Reference in New Issue
Block a user