]> git.lizzy.rs Git - rust.git/blobdiff - editors/code/src/source_change.ts
Add boolean literals to package.json
[rust.git] / editors / code / src / source_change.ts
index 399a150c6544037d2f2ade16851f6748a4541e06..af8f1df51126aac4d2cdb7971af470174aab3b56 100644 (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(