Jump to sourceChanges in other files

This commit is contained in:
Timo Freiberg
2020-04-20 18:02:36 +02:00
parent ba8faf3efc
commit 74780a15f6
3 changed files with 15 additions and 16 deletions

View File

@@ -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(