@@ -34,8 +34,8 @@ import { ICodeEditor, IDiffEditorConstructionOptions, isCodeEditor } from 'vs/ed
34
34
import { EditorAction2 } from 'vs/editor/browser/editorExtensions' ;
35
35
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService' ;
36
36
import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget' ;
37
- import { DiffEditorWidget } from 'vs/editor/browser/widget/diffEditorWidget ' ;
38
- import { EmbeddedCodeEditorWidget , EmbeddedDiffEditorWidget } from 'vs/editor/browser/widget/embeddedCodeEditorWidget' ;
37
+ import { DiffEditorWidget2 } from 'vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2 ' ;
38
+ import { EmbeddedCodeEditorWidget , EmbeddedDiffEditorWidget2 } from 'vs/editor/browser/widget/embeddedCodeEditorWidget' ;
39
39
import { IDiffEditorOptions , IEditorOptions } from 'vs/editor/common/config/editorOptions' ;
40
40
import { Position } from 'vs/editor/common/core/position' ;
41
41
import { Range } from 'vs/editor/common/core/range' ;
@@ -54,6 +54,7 @@ import { ContextKeyExpr, IContextKey, IContextKeyService } from 'vs/platform/con
54
54
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView' ;
55
55
import { ITextEditorOptions } from 'vs/platform/editor/common/editor' ;
56
56
import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
57
+ import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' ;
57
58
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
58
59
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
59
60
import { WorkbenchCompressibleObjectTree } from 'vs/platform/list/browser/listService' ;
@@ -801,16 +802,16 @@ class TestResultsPeek extends PeekViewWidget {
801
802
private static lastHeightInLines ?: number ;
802
803
803
804
private readonly visibilityChange = this . _disposables . add ( new Emitter < boolean > ( ) ) ;
804
- private readonly content : TestResultsViewContent ;
805
- private scopedContextKeyService ? : IContextKeyService ;
805
+ private content ! : TestResultsViewContent ;
806
+ private scopedContextKeyService ! : IContextKeyService ;
806
807
private dimension ?: dom . Dimension ;
807
808
public current ?: InspectSubject ;
808
809
809
810
constructor (
810
811
editor : ICodeEditor ,
811
812
@IThemeService themeService : IThemeService ,
812
813
@IPeekViewService peekViewService : IPeekViewService ,
813
- @ITestingPeekOpener testingPeek : ITestingPeekOpener ,
814
+ @ITestingPeekOpener private readonly testingPeek : ITestingPeekOpener ,
814
815
@IContextKeyService private readonly contextKeyService : IContextKeyService ,
815
816
@IMenuService private readonly menuService : IMenuService ,
816
817
@IInstantiationService instantiationService : IInstantiationService ,
@@ -820,7 +821,6 @@ class TestResultsPeek extends PeekViewWidget {
820
821
821
822
this . _disposables . add ( themeService . onDidColorThemeChange ( this . applyTheme , this ) ) ;
822
823
this . _disposables . add ( this . onDidClose ( ( ) => this . visibilityChange . fire ( false ) ) ) ;
823
- this . content = this . _disposables . add ( instantiationService . createInstance ( TestResultsViewContent , editor , { historyVisible : testingPeek . historyVisible , showRevealLocationOnMessages : false } ) ) ;
824
824
this . applyTheme ( themeService . getColorTheme ( ) ) ;
825
825
peekViewService . addExclusiveWidget ( editor , this ) ;
826
826
}
@@ -841,11 +841,14 @@ class TestResultsPeek extends PeekViewWidget {
841
841
if ( ! this . scopedContextKeyService ) {
842
842
this . scopedContextKeyService = this . _disposables . add ( this . contextKeyService . createScoped ( container ) ) ;
843
843
TestingContextKeys . isInPeek . bindTo ( this . scopedContextKeyService ) . set ( true ) ;
844
+ const instaService = this . instantiationService . createChild ( new ServiceCollection ( [ IContextKeyService , this . scopedContextKeyService ] ) ) ;
845
+ this . content = this . _disposables . add ( instaService . createInstance ( TestResultsViewContent , this . editor , { historyVisible : this . testingPeek . historyVisible , showRevealLocationOnMessages : false } ) ) ;
844
846
}
845
847
846
848
super . _fillContainer ( container ) ;
847
849
}
848
850
851
+
849
852
protected override _fillHead ( container : HTMLElement ) : void {
850
853
super . _fillHead ( container ) ;
851
854
@@ -1025,7 +1028,7 @@ const isDiffable = (message: ITestMessage): message is ITestErrorMessage & { act
1025
1028
message . type === TestMessageType . Error && message . actual !== undefined && message . expected !== undefined ;
1026
1029
1027
1030
class DiffContentProvider extends Disposable implements IPeekOutputRenderer {
1028
- private readonly widget = this . _register ( new MutableDisposable < DiffEditorWidget > ( ) ) ;
1031
+ private readonly widget = this . _register ( new MutableDisposable < DiffEditorWidget2 > ( ) ) ;
1029
1032
private readonly model = this . _register ( new MutableDisposable ( ) ) ;
1030
1033
private dimension ?: dom . IDimension ;
1031
1034
@@ -1055,13 +1058,13 @@ class DiffContentProvider extends Disposable implements IPeekOutputRenderer {
1055
1058
const model = this . model . value = new SimpleDiffEditorModel ( original , modified ) ;
1056
1059
if ( ! this . widget . value ) {
1057
1060
this . widget . value = this . editor ? this . instantiationService . createInstance (
1058
- EmbeddedDiffEditorWidget ,
1061
+ EmbeddedDiffEditorWidget2 ,
1059
1062
this . container ,
1060
1063
diffEditorOptions ,
1061
1064
{ } ,
1062
1065
this . editor ,
1063
1066
) : this . instantiationService . createInstance (
1064
- DiffEditorWidget ,
1067
+ DiffEditorWidget2 ,
1065
1068
this . container ,
1066
1069
diffEditorOptions ,
1067
1070
{ } ,
@@ -1406,7 +1409,7 @@ function getOuterEditorFromDiffEditor(codeEditorService: ICodeEditorService): IC
1406
1409
const diffEditors = codeEditorService . listDiffEditors ( ) ;
1407
1410
1408
1411
for ( const diffEditor of diffEditors ) {
1409
- if ( diffEditor . hasTextFocus ( ) && diffEditor instanceof EmbeddedDiffEditorWidget ) {
1412
+ if ( diffEditor . hasTextFocus ( ) && diffEditor instanceof EmbeddedDiffEditorWidget2 ) {
1410
1413
return diffEditor . getParentEditor ( ) ;
1411
1414
}
1412
1415
}
0 commit comments