Skip to content

Commit 866f22e

Browse files
authored
1 parent ce7ced7 commit 866f22e

2 files changed

Lines changed: 93 additions & 33 deletions

File tree

src/vs/workbench/contrib/mergeEditor/browser/commands/commands.ts

Lines changed: 79 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import { Codicon } from 'vs/base/common/codicons';
77
import { URI, UriComponents } from 'vs/base/common/uri';
88
import { localize } from 'vs/nls';
9+
import { ILocalizedString } from 'vs/platform/action/common/action';
910
import { Action2, MenuId } from 'vs/platform/actions/common/actions';
1011
import { ICommandService } from 'vs/platform/commands/common/commands';
1112
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
@@ -19,7 +20,7 @@ export class OpenMergeEditor extends Action2 {
1920
constructor() {
2021
super({
2122
id: '_open.mergeEditor',
22-
title: localize('title', "Open Merge Editor"),
23+
title: { value: localize('title', "Open Merge Editor"), original: 'Open Merge Editor' },
2324
});
2425
}
2526
run(accessor: ServicesAccessor, ...args: unknown[]): void {
@@ -111,14 +112,19 @@ export class SetMixedLayout extends Action2 {
111112
constructor() {
112113
super({
113114
id: 'merge.mixedLayout',
114-
title: localize('layout.mixed', "Mixed Layout"),
115+
title: {
116+
value: localize('layout.mixed', 'Mixed Layout'),
117+
original: 'Mixed Layout',
118+
},
115119
toggled: ctxMergeEditorLayout.isEqualTo('mixed'),
116-
menu: [{
117-
id: MenuId.EditorTitle,
118-
when: ctxIsMergeEditor,
119-
group: '1_merge',
120-
order: 9,
121-
}],
120+
menu: [
121+
{
122+
id: MenuId.EditorTitle,
123+
when: ctxIsMergeEditor,
124+
group: '1_merge',
125+
order: 9,
126+
},
127+
],
122128
precondition: ctxIsMergeEditor,
123129
});
124130
}
@@ -135,7 +141,7 @@ export class SetColumnLayout extends Action2 {
135141
constructor() {
136142
super({
137143
id: 'merge.columnLayout',
138-
title: localize('layout.column', "Column Layout"),
144+
title: { value: localize('layout.column', "Column Layout"), original: 'Column Layout' },
139145
toggled: ctxMergeEditorLayout.isEqualTo('columns'),
140146
menu: [{
141147
id: MenuId.EditorTitle,
@@ -155,18 +161,28 @@ export class SetColumnLayout extends Action2 {
155161
}
156162
}
157163

164+
const mergeEditorCategory: ILocalizedString = {
165+
value: localize('mergeEditor', 'Merge Editor'),
166+
original: 'Merge Editor',
167+
};
168+
158169
export class GoToNextConflict extends Action2 {
159170
constructor() {
160171
super({
161172
id: 'merge.goToNextConflict',
162-
category: localize('mergeEditor', "Merge Editor"),
163-
title: localize('merge.goToNextConflict', "Go to Next Conflict"),
173+
category: mergeEditorCategory,
174+
title: {
175+
value: localize('merge.goToNextConflict', 'Go to Next Conflict'),
176+
original: 'Go to Next Conflict',
177+
},
164178
icon: Codicon.arrowDown,
165-
menu: [{
166-
id: MenuId.EditorTitle,
167-
when: ctxIsMergeEditor,
168-
group: 'navigation',
169-
}],
179+
menu: [
180+
{
181+
id: MenuId.EditorTitle,
182+
when: ctxIsMergeEditor,
183+
group: 'navigation',
184+
},
185+
],
170186
f1: true,
171187
precondition: ctxIsMergeEditor,
172188
});
@@ -184,14 +200,22 @@ export class GoToPreviousConflict extends Action2 {
184200
constructor() {
185201
super({
186202
id: 'merge.goToPreviousConflict',
187-
category: localize('mergeEditor', "Merge Editor"),
188-
title: localize('merge.goToPreviousConflict', "Go to Previous Conflict"),
203+
category: mergeEditorCategory,
204+
title: {
205+
value: localize(
206+
'merge.goToPreviousConflict',
207+
'Go to Previous Conflict'
208+
),
209+
original: 'Go to Previous Conflict',
210+
},
189211
icon: Codicon.arrowUp,
190-
menu: [{
191-
id: MenuId.EditorTitle,
192-
when: ctxIsMergeEditor,
193-
group: 'navigation',
194-
}],
212+
menu: [
213+
{
214+
id: MenuId.EditorTitle,
215+
when: ctxIsMergeEditor,
216+
group: 'navigation',
217+
},
218+
],
195219
f1: true,
196220
precondition: ctxIsMergeEditor,
197221
});
@@ -209,8 +233,14 @@ export class ToggleActiveConflictInput1 extends Action2 {
209233
constructor() {
210234
super({
211235
id: 'merge.toggleActiveConflictInput1',
212-
category: localize('mergeEditor', "Merge Editor"),
213-
title: localize('merge.toggleCurrentConflictFromLeft', "Toggle Current Conflict from Left"),
236+
category: mergeEditorCategory,
237+
title: {
238+
value: localize(
239+
'merge.toggleCurrentConflictFromLeft',
240+
'Toggle Current Conflict from Left'
241+
),
242+
original: 'Toggle Current Conflict from Left',
243+
},
214244
f1: true,
215245
precondition: ctxIsMergeEditor,
216246
});
@@ -232,8 +262,14 @@ export class ToggleActiveConflictInput2 extends Action2 {
232262
constructor() {
233263
super({
234264
id: 'merge.toggleActiveConflictInput2',
235-
category: localize('mergeEditor', "Merge Editor"),
236-
title: localize('merge.toggleCurrentConflictFromRight', "Toggle Current Conflict from Right"),
265+
category: mergeEditorCategory,
266+
title: {
267+
value: localize(
268+
'merge.toggleCurrentConflictFromRight',
269+
'Toggle Current Conflict from Right'
270+
),
271+
original: 'Toggle Current Conflict from Right',
272+
},
237273
f1: true,
238274
precondition: ctxIsMergeEditor,
239275
});
@@ -255,8 +291,14 @@ export class CompareInput1WithBaseCommand extends Action2 {
255291
constructor() {
256292
super({
257293
id: 'mergeEditor.compareInput1WithBase',
258-
category: localize('mergeEditor', "Merge Editor"),
259-
title: localize('mergeEditor.compareInput1WithBase', "Compare Input 1 With Base"),
294+
category: mergeEditorCategory,
295+
title: {
296+
value: localize(
297+
'mergeEditor.compareInput1WithBase',
298+
'Compare Input 1 With Base'
299+
),
300+
original: 'Compare Input 1 With Base',
301+
},
260302
f1: true,
261303
precondition: ctxIsMergeEditor,
262304
});
@@ -272,8 +314,14 @@ export class CompareInput2WithBaseCommand extends Action2 {
272314
constructor() {
273315
super({
274316
id: 'mergeEditor.compareInput2WithBase',
275-
category: localize('mergeEditor', "Merge Editor"),
276-
title: localize('mergeEditor.compareInput2WithBase', "Compare Input 2 With Base"),
317+
category: mergeEditorCategory,
318+
title: {
319+
value: localize(
320+
'mergeEditor.compareInput2WithBase',
321+
'Compare Input 2 With Base'
322+
),
323+
original: 'Compare Input 2 With Base',
324+
},
277325
f1: true,
278326
precondition: ctxIsMergeEditor,
279327
});

src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ export class MergeEditorCopyContentsToJSON extends Action2 {
3434
super({
3535
id: 'merge.dev.copyContents',
3636
category: 'Merge Editor (Dev)',
37-
title: localize('merge.dev.copyContents', "Copy Contents of Inputs, Base and Result as JSON"),
37+
title: {
38+
value: localize(
39+
'merge.dev.copyContents',
40+
'Copy Contents of Inputs, Base and Result as JSON'
41+
),
42+
original: 'Copy Contents of Inputs, Base and Result as JSON',
43+
},
3844
icon: Codicon.layoutCentered,
3945
f1: true,
4046
precondition: ctxIsMergeEditor,
@@ -80,7 +86,13 @@ export class MergeEditorOpenContents extends Action2 {
8086
super({
8187
id: 'merge.dev.openContents',
8288
category: 'Merge Editor (Dev)',
83-
title: localize('merge.dev.openContents', "Open Contents of Inputs, Base and Result from JSON"),
89+
title: {
90+
value: localize(
91+
'merge.dev.openContents',
92+
'Open Contents of Inputs, Base and Result from JSON'
93+
),
94+
original: 'Open Contents of Inputs, Base and Result from JSON',
95+
},
8496
icon: Codicon.layoutCentered,
8597
f1: true,
8698
});

0 commit comments

Comments
 (0)