From 74780a15f65916d08942eb53c43b8e8c0b62cb48 Mon Sep 17 00:00:00 2001 From: Timo Freiberg Date: Mon, 20 Apr 2020 18:02:36 +0200 Subject: Jump to sourceChanges in other files --- editors/code/src/source_change.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'editors/code/src/source_change.ts') diff --git a/editors/code/src/source_change.ts b/editors/code/src/source_change.ts index 399a150c6..af8f1df51 100644 --- a/editors/code/src/source_change.ts +++ b/editors/code/src/source_change.ts @@ -37,11 +37,13 @@ export async function applySourceChange(ctx: Ctx, change: ra.SourceChange) { toReveal.position, ); const editor = vscode.window.activeTextEditor; - if (!editor || editor.document.uri.toString() !== uri.toString()) { + if (!editor || !editor.selection.isEmpty) { return; } - if (!editor.selection.isEmpty) { - return; + + if (editor.document.uri !== uri) { + const doc = await vscode.workspace.openTextDocument(uri); + await vscode.window.showTextDocument(doc); } editor.selection = new vscode.Selection(position, position); editor.revealRange( -- cgit v1.2.3