aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/commands.ts33
1 files changed, 17 insertions, 16 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index 3512fefdf..d43db7307 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -566,24 +566,25 @@ export function peekTests(ctx: Ctx): Cmd {
566 const editor = ctx.activeRustEditor; 566 const editor = ctx.activeRustEditor;
567 if (!editor || !client) return; 567 if (!editor || !client) return;
568 568
569 const uri = editor.document.uri.toString(); 569 await vscode.window.withProgress({
570 const position = client.code2ProtocolConverter.asPosition( 570 location: vscode.ProgressLocation.Notification,
571 editor.selection.active, 571 title: "Looking for tests...",
572 ); 572 cancellable: false,
573 573 }, async (_progress, _token) => {
574 const tests = await client.sendRequest(ra.relatedTests, { 574 const uri = editor.document.uri.toString();
575 textDocument: { uri: uri }, 575 const position = client.code2ProtocolConverter.asPosition(
576 position: position, 576 editor.selection.active,
577 }); 577 );
578 578
579 const locations: lc.Location[] = tests.map( it => { 579 const tests = await client.sendRequest(ra.relatedTests, {
580 return { 580 textDocument: { uri: uri },
581 uri: it.runnable.location!.targetUri, 581 position: position,
582 range: it.runnable.location!.targetSelectionRange 582 });
583 }; 583 const locations: lc.Location[] = tests.map(it =>
584 }); 584 lc.Location.create(it.runnable.location!.targetUri, it.runnable.location!.targetSelectionRange));
585 585
586 await showReferencesImpl(client, uri, position, locations); 586 await showReferencesImpl(client, uri, position, locations);
587 });
587 }; 588 };
588} 589}
589 590