@@ -711,13 +711,10 @@ class TestResultsViewContent extends Disposable {
711711 historyVisible : IObservableValue < boolean > ;
712712 showRevealLocationOnMessages : boolean ;
713713 } ,
714- @IContextKeyService contextKeyService : IContextKeyService ,
715714 @IInstantiationService private readonly instantiationService : IInstantiationService ,
716715 @ITextModelService protected readonly modelService : ITextModelService ,
717716 ) {
718717 super ( ) ;
719-
720- TestingContextKeys . isInPeek . bindTo ( contextKeyService ) ;
721718 }
722719
723720 public fillBody ( containerElement : HTMLElement ) : void {
@@ -806,6 +803,7 @@ class TestResultsPeek extends PeekViewWidget {
806803
807804 private readonly visibilityChange = this . _disposables . add ( new Emitter < boolean > ( ) ) ;
808805 private readonly content : TestResultsViewContent ;
806+ private scopedContextKeyService ?: IContextKeyService ;
809807 private dimension ?: dom . Dimension ;
810808 public current ?: InspectSubject ;
811809
@@ -821,7 +819,6 @@ class TestResultsPeek extends PeekViewWidget {
821819 ) {
822820 super ( editor , { showFrame : true , frameWidth : 1 , showArrow : true , isResizeable : true , isAccessible : true , className : 'test-output-peek' } , instantiationService ) ;
823821
824- TestingContextKeys . isInPeek . bindTo ( contextKeyService ) ;
825822 this . _disposables . add ( themeService . onDidColorThemeChange ( this . applyTheme , this ) ) ;
826823 this . _disposables . add ( this . onDidClose ( ( ) => this . visibilityChange . fire ( false ) ) ) ;
827824 this . content = this . _disposables . add ( instantiationService . createInstance ( TestResultsViewContent , editor , { historyVisible : testingPeek . historyVisible , showRevealLocationOnMessages : false } ) ) ;
@@ -841,6 +838,15 @@ class TestResultsPeek extends PeekViewWidget {
841838 } ) ;
842839 }
843840
841+ protected override _fillContainer ( container : HTMLElement ) : void {
842+ if ( ! this . scopedContextKeyService ) {
843+ this . scopedContextKeyService = this . _disposables . add ( this . contextKeyService . createScoped ( container ) ) ;
844+ TestingContextKeys . isInPeek . bindTo ( this . scopedContextKeyService ) . set ( true ) ;
845+ }
846+
847+ super . _fillContainer ( container ) ;
848+ }
849+
844850 protected override _fillHead ( container : HTMLElement ) : void {
845851 super . _fillHead ( container ) ;
846852
0 commit comments