Skip to content

Commit 7d8c2f6

Browse files
committed
Fixes for amd resource adoption (microsoft#80654)
1 parent 7bb6df9 commit 7d8c2f6

File tree

3 files changed

+29
-18
lines changed

3 files changed

+29
-18
lines changed

src/vs/workbench/browser/parts/editor/editor.contribution.ts

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -479,41 +479,49 @@ function appendEditorToolItem(primary: IEditorToolItem, when: ContextKeyExpr | u
479479
MenuRegistry.appendMenuItem(MenuId.EditorTitle, item);
480480
}
481481

482+
const SPLIT_EDITOR_HORIZONTAL_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-dark.svg'));
483+
const SPLIT_EDITOR_HORIZONTAL_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-light.svg'));
484+
const SPLIT_EDITOR_VERTICAL_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-dark.svg'));
485+
const SPLIT_EDITOR_VERTICAL_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-light.svg'));
486+
482487
// Editor Title Menu: Split Editor
483488
appendEditorToolItem(
484489
{
485490
id: SplitEditorAction.ID,
486491
title: nls.localize('splitEditorRight', "Split Editor Right"),
487-
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-dark.svg')),
488-
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-light.svg'))
492+
iconDark: SPLIT_EDITOR_HORIZONTAL_DARK_ICON,
493+
iconLight: SPLIT_EDITOR_HORIZONTAL_LIGHT_ICON
489494
},
490495
ContextKeyExpr.not('splitEditorsVertically'),
491496
100000, // towards the end
492497
{
493498
id: editorCommands.SPLIT_EDITOR_DOWN,
494499
title: nls.localize('splitEditorDown', "Split Editor Down"),
495-
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-dark.svg')),
496-
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-light.svg'))
500+
iconDark: SPLIT_EDITOR_VERTICAL_DARK_ICON,
501+
iconLight: SPLIT_EDITOR_VERTICAL_LIGHT_ICON
497502
}
498503
);
499504

500505
appendEditorToolItem(
501506
{
502507
id: SplitEditorAction.ID,
503508
title: nls.localize('splitEditorDown', "Split Editor Down"),
504-
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-dark.svg')),
505-
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-vertical-light.svg'))
509+
iconDark: SPLIT_EDITOR_VERTICAL_DARK_ICON,
510+
iconLight: SPLIT_EDITOR_VERTICAL_LIGHT_ICON
506511
},
507512
ContextKeyExpr.has('splitEditorsVertically'),
508513
100000, // towards the end
509514
{
510515
id: editorCommands.SPLIT_EDITOR_RIGHT,
511516
title: nls.localize('splitEditorRight', "Split Editor Right"),
512-
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-dark.svg')),
513-
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/split-editor-horizontal-light.svg'))
517+
iconDark: SPLIT_EDITOR_HORIZONTAL_DARK_ICON,
518+
iconLight: SPLIT_EDITOR_HORIZONTAL_LIGHT_ICON
514519
}
515520
);
516521

522+
const CLOSE_ALL_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-dark.svg'));
523+
const CLOSE_ALL_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-light.svg'));
524+
517525
// Editor Title Menu: Close Group (tabs disabled)
518526
appendEditorToolItem(
519527
{
@@ -527,8 +535,8 @@ appendEditorToolItem(
527535
{
528536
id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
529537
title: nls.localize('closeAll', "Close All"),
530-
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-dark.svg')),
531-
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-light.svg'))
538+
iconDark: CLOSE_ALL_DARK_ICON,
539+
iconLight: CLOSE_ALL_LIGHT_ICON
532540
}
533541
);
534542

@@ -544,8 +552,8 @@ appendEditorToolItem(
544552
{
545553
id: editorCommands.CLOSE_EDITORS_IN_GROUP_COMMAND_ID,
546554
title: nls.localize('closeAll', "Close All"),
547-
iconDark: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-dark.svg')),
548-
iconLight: URI.parse(registerAndGetAmdImageURL('vs/workbench/browser/parts/editor/media/close-all-light.svg'))
555+
iconDark: CLOSE_ALL_DARK_ICON,
556+
iconLight: CLOSE_ALL_LIGHT_ICON
549557
}
550558
);
551559

src/vs/workbench/contrib/codeEditor/browser/toggleWordWrap.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,16 @@ registerEditorContribution(ToggleWordWrapController);
272272

273273
registerEditorAction(ToggleWordWrapAction);
274274

275+
const WORD_WRAP_DARK_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-dark.svg'));
276+
const WORD_WRAP_LIGHT_ICON = URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-light.svg'));
277+
275278
MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
276279
command: {
277280
id: TOGGLE_WORD_WRAP_ID,
278281
title: nls.localize('unwrapMinified', "Disable wrapping for this file"),
279282
iconLocation: {
280-
dark: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-dark.svg')),
281-
light: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-light.svg'))
283+
dark: WORD_WRAP_DARK_ICON,
284+
light: WORD_WRAP_LIGHT_ICON
282285
}
283286
},
284287
group: 'navigation',
@@ -294,8 +297,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
294297
id: TOGGLE_WORD_WRAP_ID,
295298
title: nls.localize('wrapMinified', "Enable wrapping for this file"),
296299
iconLocation: {
297-
dark: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-dark.svg')),
298-
light: URI.parse(registerAndGetAmdImageURL('vs/workbench/contrib/codeEditor/browser/word-wrap-light.svg'))
300+
dark: WORD_WRAP_DARK_ICON,
301+
light: WORD_WRAP_LIGHT_ICON
299302
}
300303
},
301304
group: 'navigation',

src/vs/workbench/contrib/preferences/browser/preferences.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -820,8 +820,8 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
820820
id: SETTINGS_EDITOR_COMMAND_SWITCH_TO_JSON,
821821
title: nls.localize('openSettingsJson', "Open Settings (JSON)"),
822822
iconLocation: {
823-
dark: URI.parse(require.toUrl('vs/workbench/contrib/preferences/browser/media/preferences-editor-dark.svg')),
824-
light: URI.parse(require.toUrl('vs/workbench/contrib/preferences/browser/media/preferences-editor-light.svg'))
823+
dark: PREFERENCES_EDITOR_DARK_ICON_URI,
824+
light: PREFERENCES_EDITOR_LIGHT_ICON_URI
825825
}
826826
},
827827
group: 'navigation',

0 commit comments

Comments
 (0)