@@ -38,7 +38,7 @@ import { IKeybindingService } from '../../../../platform/keybinding/common/keybi
3838import { KeybindingWeight } from '../../../../platform/keybinding/common/keybindingsRegistry.js' ;
3939import { ILogService } from '../../../../platform/log/common/log.js' ;
4040import { bindContextKey , observableConfigValue } from '../../../../platform/observable/common/platformObservableUtils.js' ;
41- import { IQuickInputService , QuickPickInput } from '../../../../platform/quickinput/common/quickInput.js' ;
41+ import { IQuickInputButton , IQuickInputService , QuickPickInput } from '../../../../platform/quickinput/common/quickInput.js' ;
4242import { ActiveEditorContext } from '../../../common/contextkeys.js' ;
4343import { TEXT_FILE_EDITOR_ID } from '../../files/common/files.js' ;
4444import { getTestingConfiguration , TestingConfigKeys } from '../common/configuration.js' ;
@@ -791,6 +791,7 @@ registerAction2(class FilterCoverageToTestInEditor extends Action2 {
791791 run ( accessor : ServicesAccessor , coverageOrUri ?: FileCoverage | URI , editor ?: ICodeEditor ) : void {
792792 const testCoverageService = accessor . get ( ITestCoverageService ) ;
793793 const quickInputService = accessor . get ( IQuickInputService ) ;
794+ const commandService = accessor . get ( ICommandService ) ;
794795 const activeEditor = isCodeEditor ( editor ) ? editor : accessor . get ( ICodeEditorService ) . getActiveCodeEditor ( ) ;
795796 let coverage : FileCoverage | undefined ;
796797 if ( coverageOrUri instanceof FileCoverage ) {
@@ -811,23 +812,30 @@ registerAction2(class FilterCoverageToTestInEditor extends Action2 {
811812 const result = coverage . fromResult ;
812813 const previousSelection = testCoverageService . filterToTest . get ( ) ;
813814
814- type TItem = { label : string ; testId : TestId | undefined } ;
815+ type TItem = { label : string ; testId : TestId | undefined ; buttons ?: IQuickInputButton [ ] } ;
815816
817+ const buttons : IQuickInputButton [ ] = [ {
818+ iconClass : 'codicon-go-to-file' ,
819+ tooltip : 'Go to Test' ,
820+ } ] ;
816821 const items : QuickPickInput < TItem > [ ] = [
817822 { label : coverUtils . labels . allTests , testId : undefined } ,
818823 { type : 'separator' } ,
819- ...tests . map ( id => ( { label : coverUtils . getLabelForItem ( result , id , commonPrefix ) , testId : id } ) ) ,
824+ ...tests . map ( id => ( { label : coverUtils . getLabelForItem ( result , id , commonPrefix ) , testId : id , buttons } ) ) ,
820825 ] ;
821826
822827 // These handle the behavior that reveals the start of coverage when the
823828 // user picks from the quickpick. Scroll position is restored if the user
824- // exits without picking an item, or picks "all tets ".
829+ // exits without picking an item, or picks "all tests ".
825830 const scrollTop = activeEditor ?. getScrollTop ( ) || 0 ;
826831 const revealScrollCts = new MutableDisposable < CancellationTokenSource > ( ) ;
827832
828833 quickInputService . pick ( items , {
829834 activeItem : items . find ( ( item ) : item is TItem => 'item' in item && item . item === coverage ) ,
830835 placeHolder : coverUtils . labels . pickShowCoverage ,
836+ onDidTriggerItemButton : ( context ) => {
837+ commandService . executeCommand ( 'vscode.revealTest' , context . item . testId ?. toString ( ) ) ;
838+ } ,
831839 onDidFocus : ( entry ) => {
832840 if ( ! entry . testId ) {
833841 revealScrollCts . clear ( ) ;
0 commit comments