@@ -8,11 +8,11 @@ import { URI, UriComponents } from 'vs/base/common/uri';
8
8
import { localize } from 'vs/nls' ;
9
9
import { Action2 , MenuId } from 'vs/platform/actions/common/actions' ;
10
10
import { ICommandService } from 'vs/platform/commands/common/commands' ;
11
- import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey' ;
12
11
import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
13
12
import { API_OPEN_DIFF_EDITOR_COMMAND_ID } from 'vs/workbench/browser/parts/editor/editorCommands' ;
14
13
import { MergeEditorInput , MergeEditorInputData } from 'vs/workbench/contrib/mergeEditor/browser/mergeEditorInput' ;
15
- import { ctxIsMergeEditor , ctxMergeEditorLayout , MergeEditor } from 'vs/workbench/contrib/mergeEditor/browser/view/mergeEditor' ;
14
+ import { MergeEditor } from 'vs/workbench/contrib/mergeEditor/browser/view/mergeEditor' ;
15
+ import { ctxMergeEditorLayout , ctxIsMergeEditor } from 'vs/workbench/contrib/mergeEditor/common/mergeEditor' ;
16
16
import { IEditorService } from 'vs/workbench/services/editor/common/editorService' ;
17
17
18
18
export class OpenMergeEditor extends Action2 {
@@ -112,13 +112,14 @@ export class SetMixedLayout extends Action2 {
112
112
super ( {
113
113
id : 'merge.mixedLayout' ,
114
114
title : localize ( 'layout.mixed' , "Mixed Layout" ) ,
115
- toggled : ContextKeyExpr . equals ( ctxMergeEditorLayout . key , 'mixed' ) ,
115
+ toggled : ctxMergeEditorLayout . isEqualTo ( 'mixed' ) ,
116
116
menu : [ {
117
117
id : MenuId . EditorTitle ,
118
118
when : ctxIsMergeEditor ,
119
119
group : '1_merge' ,
120
120
order : 9 ,
121
- } ]
121
+ } ] ,
122
+ precondition : ctxIsMergeEditor ,
122
123
} ) ;
123
124
}
124
125
@@ -135,13 +136,14 @@ export class SetColumnLayout extends Action2 {
135
136
super ( {
136
137
id : 'merge.columnLayout' ,
137
138
title : localize ( 'layout.column' , "Column Layout" ) ,
138
- toggled : ContextKeyExpr . equals ( ctxMergeEditorLayout . key , 'columns' ) ,
139
+ toggled : ctxMergeEditorLayout . isEqualTo ( 'columns' ) ,
139
140
menu : [ {
140
141
id : MenuId . EditorTitle ,
141
142
when : ctxIsMergeEditor ,
142
143
group : '1_merge' ,
143
144
order : 10 ,
144
- } ]
145
+ } ] ,
146
+ precondition : ctxIsMergeEditor ,
145
147
} ) ;
146
148
}
147
149
@@ -166,6 +168,7 @@ export class GoToNextConflict extends Action2 {
166
168
group : 'navigation' ,
167
169
} ] ,
168
170
f1 : true ,
171
+ precondition : ctxIsMergeEditor ,
169
172
} ) ;
170
173
}
171
174
@@ -190,6 +193,7 @@ export class GoToPreviousConflict extends Action2 {
190
193
group : 'navigation' ,
191
194
} ] ,
192
195
f1 : true ,
196
+ precondition : ctxIsMergeEditor ,
193
197
} ) ;
194
198
}
195
199
@@ -208,6 +212,7 @@ export class ToggleActiveConflictInput1 extends Action2 {
208
212
category : localize ( 'mergeEditor' , "Merge Editor" ) ,
209
213
title : localize ( 'merge.toggleActiveConflictInput1' , "Toggle Active Conflict In Input 1" ) ,
210
214
f1 : true ,
215
+ precondition : ctxIsMergeEditor ,
211
216
} ) ;
212
217
}
213
218
@@ -230,6 +235,7 @@ export class ToggleActiveConflictInput2 extends Action2 {
230
235
category : localize ( 'mergeEditor' , "Merge Editor" ) ,
231
236
title : localize ( 'merge.toggleActiveConflictInput2' , "Toggle Active Conflict In Input 2" ) ,
232
237
f1 : true ,
238
+ precondition : ctxIsMergeEditor ,
233
239
} ) ;
234
240
}
235
241
@@ -252,6 +258,7 @@ export class CompareInput1WithBaseCommand extends Action2 {
252
258
category : localize ( 'mergeEditor' , "Merge Editor" ) ,
253
259
title : localize ( 'mergeEditor.compareInput1WithBase' , "Compare Input 1 With Base" ) ,
254
260
f1 : true ,
261
+ precondition : ctxIsMergeEditor ,
255
262
} ) ;
256
263
}
257
264
run ( accessor : ServicesAccessor , ...args : unknown [ ] ) : void {
@@ -268,6 +275,7 @@ export class CompareInput2WithBaseCommand extends Action2 {
268
275
category : localize ( 'mergeEditor' , "Merge Editor" ) ,
269
276
title : localize ( 'mergeEditor.compareInput2WithBase' , "Compare Input 2 With Base" ) ,
270
277
f1 : true ,
278
+ precondition : ctxIsMergeEditor ,
271
279
} ) ;
272
280
}
273
281
run ( accessor : ServicesAccessor , ...args : unknown [ ] ) : void {
0 commit comments