From 8da3ea97abf78d3a7ae7d94fbcac3382882197ea Mon Sep 17 00:00:00 2001 From: Christof Marti Date: Thu, 29 Jun 2017 12:26:33 -0700 Subject: [PATCH] Use original scheme (fixes #29872) --- extensions/merge-conflict/src/commandHandler.ts | 5 +++-- extensions/merge-conflict/src/contentProvider.ts | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/extensions/merge-conflict/src/commandHandler.ts b/extensions/merge-conflict/src/commandHandler.ts index 3de959c04bf2f..0f4134fcbbd83 100644 --- a/extensions/merge-conflict/src/commandHandler.ts +++ b/extensions/merge-conflict/src/commandHandler.ts @@ -88,14 +88,15 @@ export default class CommandHandler implements vscode.Disposable { } } + const scheme = editor.document.uri.scheme; let range = conflict.current.content; const leftUri = editor.document.uri.with({ scheme: ContentProvider.scheme, - query: JSON.stringify(range) + query: JSON.stringify({ scheme, range }) }); range = conflict.incoming.content; - const rightUri = leftUri.with({ query: JSON.stringify(range) }); + const rightUri = leftUri.with({ query: JSON.stringify({ scheme, range }) }); const title = localize('compareChangesTitle', '{0}: Current Changes ⟷ Incoming Changes', fileName); vscode.commands.executeCommand('vscode.diff', leftUri, rightUri, title); diff --git a/extensions/merge-conflict/src/contentProvider.ts b/extensions/merge-conflict/src/contentProvider.ts index 910a4b6d2d0cb..446ab052f2297 100644 --- a/extensions/merge-conflict/src/contentProvider.ts +++ b/extensions/merge-conflict/src/contentProvider.ts @@ -24,9 +24,10 @@ export default class MergeConflictContentProvider implements vscode.TextDocument async provideTextDocumentContent(uri: vscode.Uri): Promise { try { - const [start, end] = JSON.parse(uri.query) as { line: number, character: number }[]; + const { scheme, range } = JSON.parse(uri.query) as { scheme: string; range: { line: number, character: number }[] }; + const [start, end] = range; - const document = await vscode.workspace.openTextDocument(uri.with({ scheme: 'file', query: '' })); + const document = await vscode.workspace.openTextDocument(uri.with({ scheme, query: '' })); const text = document.getText(new vscode.Range(start.line, start.character, end.line, end.character)); return text; }