@@ -566,24 +566,25 @@ export function peekTests(ctx: Ctx): Cmd {
566
566
const editor = ctx . activeRustEditor ;
567
567
if ( ! editor || ! client ) return ;
568
568
569
- const uri = editor . document . uri . toString ( ) ;
570
- const position = client . code2ProtocolConverter . asPosition (
571
- editor . selection . active ,
572
- ) ;
573
-
574
- const tests = await client . sendRequest ( ra . relatedTests , {
575
- textDocument : { uri : uri } ,
576
- position : position ,
577
- } ) ;
569
+ await vscode . window . withProgress ( {
570
+ ___location : vscode . ProgressLocation . Notification ,
571
+ title : "Looking for tests..." ,
572
+ cancellable : false ,
573
+ } , async ( _progress , _token ) => {
574
+ const uri = editor . document . uri . toString ( ) ;
575
+ const position = client . code2ProtocolConverter . asPosition (
576
+ editor . selection . active ,
577
+ ) ;
578
578
579
- const locations : lc . Location [ ] = tests . map ( it => {
580
- return {
581
- uri : it . runnable . ___location ! . targetUri ,
582
- range : it . runnable . ___location ! . targetSelectionRange
583
- } ;
584
- } ) ;
579
+ const tests = await client . sendRequest ( ra . relatedTests , {
580
+ textDocument : { uri : uri } ,
581
+ position : position ,
582
+ } ) ;
583
+ const locations : lc . Location [ ] = tests . map ( it =>
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
0 commit comments