@@ -711,13 +711,10 @@ class TestResultsViewContent extends Disposable {
711
711
historyVisible : IObservableValue < boolean > ;
712
712
showRevealLocationOnMessages : boolean ;
713
713
} ,
714
- @IContextKeyService contextKeyService : IContextKeyService ,
715
714
@IInstantiationService private readonly instantiationService : IInstantiationService ,
716
715
@ITextModelService protected readonly modelService : ITextModelService ,
717
716
) {
718
717
super ( ) ;
719
-
720
- TestingContextKeys . isInPeek . bindTo ( contextKeyService ) ;
721
718
}
722
719
723
720
public fillBody ( containerElement : HTMLElement ) : void {
@@ -806,6 +803,7 @@ class TestResultsPeek extends PeekViewWidget {
806
803
807
804
private readonly visibilityChange = this . _disposables . add ( new Emitter < boolean > ( ) ) ;
808
805
private readonly content : TestResultsViewContent ;
806
+ private scopedContextKeyService ?: IContextKeyService ;
809
807
private dimension ?: dom . Dimension ;
810
808
public current ?: InspectSubject ;
811
809
@@ -821,7 +819,6 @@ class TestResultsPeek extends PeekViewWidget {
821
819
) {
822
820
super ( editor , { showFrame : true , frameWidth : 1 , showArrow : true , isResizeable : true , isAccessible : true , className : 'test-output-peek' } , instantiationService ) ;
823
821
824
- TestingContextKeys . isInPeek . bindTo ( contextKeyService ) ;
825
822
this . _disposables . add ( themeService . onDidColorThemeChange ( this . applyTheme , this ) ) ;
826
823
this . _disposables . add ( this . onDidClose ( ( ) => this . visibilityChange . fire ( false ) ) ) ;
827
824
this . content = this . _disposables . add ( instantiationService . createInstance ( TestResultsViewContent , editor , { historyVisible : testingPeek . historyVisible , showRevealLocationOnMessages : false } ) ) ;
@@ -841,6 +838,15 @@ class TestResultsPeek extends PeekViewWidget {
841
838
} ) ;
842
839
}
843
840
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
+
844
850
protected override _fillHead ( container : HTMLElement ) : void {
845
851
super . _fillHead ( container ) ;
846
852
0 commit comments