chore(vscode): update to 1.54.2

This commit is contained in:
Joe Previte
2021-03-11 10:27:10 -07:00
1459 changed files with 53404 additions and 51004 deletions

View File

@@ -5,7 +5,7 @@
import 'vs/css!./media/actions';
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
import { domEvent } from 'vs/base/browser/event';
import { Color } from 'vs/base/common/color';
@@ -34,7 +34,7 @@ class InspectContextKeysAction extends Action2 {
constructor() {
super({
id: 'workbench.action.inspectContextKeys',
title: { value: nls.localize('inspect context keys', "Inspect Context Keys"), original: 'Inspect Context Keys' },
title: { value: localize('inspect context keys', "Inspect Context Keys"), original: 'Inspect Context Keys' },
category: CATEGORIES.Developer,
f1: true
});
@@ -96,7 +96,7 @@ class ToggleScreencastModeAction extends Action2 {
constructor() {
super({
id: 'workbench.action.toggleScreencastMode',
title: { value: nls.localize('toggle screencast mode', "Toggle Screencast Mode"), original: 'Toggle Screencast Mode' },
title: { value: localize('toggle screencast mode', "Toggle Screencast Mode"), original: 'Toggle Screencast Mode' },
category: CATEGORIES.Developer,
f1: true
});
@@ -241,7 +241,7 @@ class LogStorageAction extends Action2 {
constructor() {
super({
id: 'workbench.action.logStorage',
title: { value: nls.localize({ key: 'logStorage', comment: ['A developer only action to log the contents of the storage for the current window.'] }, "Log Storage Database Contents"), original: 'Log Storage Database Contents' },
title: { value: localize({ key: 'logStorage', comment: ['A developer only action to log the contents of the storage for the current window.'] }, "Log Storage Database Contents"), original: 'Log Storage Database Contents' },
category: CATEGORIES.Developer,
f1: true
});
@@ -257,7 +257,7 @@ class LogWorkingCopiesAction extends Action2 {
constructor() {
super({
id: 'workbench.action.logWorkingCopies',
title: { value: nls.localize({ key: 'logWorkingCopies', comment: ['A developer only action to log the working copies that exist.'] }, "Log Working Copies"), original: 'Log Working Copies' },
title: { value: localize({ key: 'logWorkingCopies', comment: ['A developer only action to log the working copies that exist.'] }, "Log Working Copies"), original: 'Log Working Copies' },
category: CATEGORIES.Developer,
f1: true
});
@@ -291,7 +291,7 @@ const configurationRegistry = Registry.as<IConfigurationRegistry>(ConfigurationE
configurationRegistry.registerConfiguration({
id: 'screencastMode',
order: 9,
title: nls.localize('screencastModeConfigurationTitle', "Screencast Mode"),
title: localize('screencastModeConfigurationTitle', "Screencast Mode"),
type: 'object',
properties: {
'screencastMode.verticalOffset': {
@@ -299,18 +299,18 @@ configurationRegistry.registerConfiguration({
default: 20,
minimum: 0,
maximum: 90,
description: nls.localize('screencastMode.location.verticalPosition', "Controls the vertical offset of the screencast mode overlay from the bottom as a percentage of the workbench height.")
description: localize('screencastMode.location.verticalPosition', "Controls the vertical offset of the screencast mode overlay from the bottom as a percentage of the workbench height.")
},
'screencastMode.fontSize': {
type: 'number',
default: 56,
minimum: 20,
maximum: 100,
description: nls.localize('screencastMode.fontSize', "Controls the font size (in pixels) of the screencast mode keyboard.")
description: localize('screencastMode.fontSize', "Controls the font size (in pixels) of the screencast mode keyboard.")
},
'screencastMode.onlyKeyboardShortcuts': {
type: 'boolean',
description: nls.localize('screencastMode.onlyKeyboardShortcuts', "Only show keyboard shortcuts in screencast mode."),
description: localize('screencastMode.onlyKeyboardShortcuts', "Only show keyboard shortcuts in screencast mode."),
default: false
},
'screencastMode.keyboardOverlayTimeout': {
@@ -318,20 +318,20 @@ configurationRegistry.registerConfiguration({
default: 800,
minimum: 500,
maximum: 5000,
description: nls.localize('screencastMode.keyboardOverlayTimeout', "Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")
description: localize('screencastMode.keyboardOverlayTimeout', "Controls how long (in milliseconds) the keyboard overlay is shown in screencast mode.")
},
'screencastMode.mouseIndicatorColor': {
type: 'string',
format: 'color-hex',
default: '#FF0000',
description: nls.localize('screencastMode.mouseIndicatorColor', "Controls the color in hex (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) of the mouse indicator in screencast mode.")
description: localize('screencastMode.mouseIndicatorColor', "Controls the color in hex (#RGB, #RGBA, #RRGGBB or #RRGGBBAA) of the mouse indicator in screencast mode.")
},
'screencastMode.mouseIndicatorSize': {
type: 'number',
default: 20,
minimum: 20,
maximum: 100,
description: nls.localize('screencastMode.mouseIndicatorSize', "Controls the size (in pixels) of the mouse indicator in screencast mode.")
description: localize('screencastMode.mouseIndicatorSize', "Controls the size (in pixels) of the mouse indicator in screencast mode.")
},
}
});

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import product from 'vs/platform/product/common/product';
import { isMacintosh, isLinux, language } from 'vs/base/common/platform';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
@@ -24,7 +24,7 @@ class KeybindingsReferenceAction extends Action2 {
constructor() {
super({
id: KeybindingsReferenceAction.ID,
title: { value: nls.localize('keybindingsReference', "Keyboard Shortcuts Reference"), original: 'Keyboard Shortcuts Reference' },
title: { value: localize('keybindingsReference', "Keyboard Shortcuts Reference"), original: 'Keyboard Shortcuts Reference' },
category: CATEGORIES.Help,
f1: true,
keybinding: {
@@ -54,7 +54,7 @@ class OpenDocumentationUrlAction extends Action2 {
constructor() {
super({
id: OpenDocumentationUrlAction.ID,
title: { value: nls.localize('openDocumentationUrl', "Documentation"), original: 'Documentation' },
title: { value: localize('openDocumentationUrl', "Documentation"), original: 'Documentation' },
category: CATEGORIES.Help,
f1: true
});
@@ -78,7 +78,7 @@ class OpenIntroductoryVideosUrlAction extends Action2 {
constructor() {
super({
id: OpenIntroductoryVideosUrlAction.ID,
title: { value: nls.localize('openIntroductoryVideosUrl', "Introductory Videos"), original: 'Introductory Videos' },
title: { value: localize('openIntroductoryVideosUrl', "Introductory Videos"), original: 'Introductory Videos' },
category: CATEGORIES.Help,
f1: true
});
@@ -102,7 +102,7 @@ class OpenTipsAndTricksUrlAction extends Action2 {
constructor() {
super({
id: OpenTipsAndTricksUrlAction.ID,
title: { value: nls.localize('openTipsAndTricksUrl', "Tips and Tricks"), original: 'Tips and Tricks' },
title: { value: localize('openTipsAndTricksUrl', "Tips and Tricks"), original: 'Tips and Tricks' },
category: CATEGORIES.Help,
f1: true
});
@@ -126,7 +126,7 @@ class OpenNewsletterSignupUrlAction extends Action2 {
constructor() {
super({
id: OpenNewsletterSignupUrlAction.ID,
title: { value: nls.localize('newsletterSignup', "Signup for the VS Code Newsletter"), original: 'Signup for the VS Code Newsletter' },
title: { value: localize('newsletterSignup', "Signup for the VS Code Newsletter"), original: 'Signup for the VS Code Newsletter' },
category: CATEGORIES.Help,
f1: true
});
@@ -151,7 +151,7 @@ class OpenTwitterUrlAction extends Action2 {
constructor() {
super({
id: OpenTwitterUrlAction.ID,
title: { value: nls.localize('openTwitterUrl', "Join Us on Twitter"), original: 'Join Us on Twitter' },
title: { value: localize('openTwitterUrl', "Join Us on Twitter"), original: 'Join Us on Twitter' },
category: CATEGORIES.Help,
f1: true
});
@@ -175,7 +175,7 @@ class OpenRequestFeatureUrlAction extends Action2 {
constructor() {
super({
id: OpenRequestFeatureUrlAction.ID,
title: { value: nls.localize('openUserVoiceUrl', "Search Feature Requests"), original: 'Search Feature Requests' },
title: { value: localize('openUserVoiceUrl', "Search Feature Requests"), original: 'Search Feature Requests' },
category: CATEGORIES.Help,
f1: true
});
@@ -199,7 +199,7 @@ class OpenLicenseUrlAction extends Action2 {
constructor() {
super({
id: OpenLicenseUrlAction.ID,
title: { value: nls.localize('openLicenseUrl', "View License"), original: 'View License' },
title: { value: localize('openLicenseUrl', "View License"), original: 'View License' },
category: CATEGORIES.Help,
f1: true
});
@@ -228,7 +228,7 @@ class OpenPrivacyStatementUrlAction extends Action2 {
constructor() {
super({
id: OpenPrivacyStatementUrlAction.ID,
title: { value: nls.localize('openPrivacyStatement', "Privacy Statement"), original: 'Privacy Statement' },
title: { value: localize('openPrivacyStatement', "Privacy Statement"), original: 'Privacy Statement' },
category: CATEGORIES.Help,
f1: true
});
@@ -296,7 +296,7 @@ if (OpenDocumentationUrlAction.AVAILABLE) {
group: '1_welcome',
command: {
id: OpenDocumentationUrlAction.ID,
title: nls.localize({ key: 'miDocumentation', comment: ['&& denotes a mnemonic'] }, "&&Documentation")
title: localize({ key: 'miDocumentation', comment: ['&& denotes a mnemonic'] }, "&&Documentation")
},
order: 3
});
@@ -308,7 +308,7 @@ if (KeybindingsReferenceAction.AVAILABLE) {
group: '2_reference',
command: {
id: KeybindingsReferenceAction.ID,
title: nls.localize({ key: 'miKeyboardShortcuts', comment: ['&& denotes a mnemonic'] }, "&&Keyboard Shortcuts Reference")
title: localize({ key: 'miKeyboardShortcuts', comment: ['&& denotes a mnemonic'] }, "&&Keyboard Shortcuts Reference")
},
order: 1
});
@@ -319,7 +319,7 @@ if (OpenIntroductoryVideosUrlAction.AVAILABLE) {
group: '2_reference',
command: {
id: OpenIntroductoryVideosUrlAction.ID,
title: nls.localize({ key: 'miIntroductoryVideos', comment: ['&& denotes a mnemonic'] }, "Introductory &&Videos")
title: localize({ key: 'miIntroductoryVideos', comment: ['&& denotes a mnemonic'] }, "Introductory &&Videos")
},
order: 2
});
@@ -330,7 +330,7 @@ if (OpenTipsAndTricksUrlAction.AVAILABLE) {
group: '2_reference',
command: {
id: OpenTipsAndTricksUrlAction.ID,
title: nls.localize({ key: 'miTipsAndTricks', comment: ['&& denotes a mnemonic'] }, "Tips and Tri&&cks")
title: localize({ key: 'miTipsAndTricks', comment: ['&& denotes a mnemonic'] }, "Tips and Tri&&cks")
},
order: 3
});
@@ -342,7 +342,7 @@ if (OpenTwitterUrlAction.AVAILABLE) {
group: '3_feedback',
command: {
id: OpenTwitterUrlAction.ID,
title: nls.localize({ key: 'miTwitter', comment: ['&& denotes a mnemonic'] }, "&&Join Us on Twitter")
title: localize({ key: 'miTwitter', comment: ['&& denotes a mnemonic'] }, "&&Join Us on Twitter")
},
order: 1
});
@@ -353,7 +353,7 @@ if (OpenRequestFeatureUrlAction.AVAILABLE) {
group: '3_feedback',
command: {
id: OpenRequestFeatureUrlAction.ID,
title: nls.localize({ key: 'miUserVoice', comment: ['&& denotes a mnemonic'] }, "&&Search Feature Requests")
title: localize({ key: 'miUserVoice', comment: ['&& denotes a mnemonic'] }, "&&Search Feature Requests")
},
order: 2
});
@@ -365,7 +365,7 @@ if (OpenLicenseUrlAction.AVAILABLE) {
group: '4_legal',
command: {
id: OpenLicenseUrlAction.ID,
title: nls.localize({ key: 'miLicense', comment: ['&& denotes a mnemonic'] }, "View &&License")
title: localize({ key: 'miLicense', comment: ['&& denotes a mnemonic'] }, "View &&License")
},
order: 1
});
@@ -376,7 +376,7 @@ if (OpenPrivacyStatementUrlAction.AVAILABE) {
group: '4_legal',
command: {
id: OpenPrivacyStatementUrlAction.ID,
title: nls.localize({ key: 'miPrivacyStatement', comment: ['&& denotes a mnemonic'] }, "Privac&&y Statement")
title: localize({ key: 'miPrivacyStatement', comment: ['&& denotes a mnemonic'] }, "Privac&&y Statement")
},
order: 2
});

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { Registry } from 'vs/platform/registry/common/platform';
import { Action } from 'vs/base/common/actions';
import { SyncActionDescriptor, MenuId, MenuRegistry, registerAction2, Action2 } from 'vs/platform/actions/common/actions';
@@ -33,7 +33,7 @@ class CloseSidebarAction extends Action2 {
constructor() {
super({
id: 'workbench.action.closeSidebar',
title: { value: nls.localize('closeSidebar', "Close Side Bar"), original: 'Close Side Bar' },
title: { value: localize('closeSidebar', "Close Side Bar"), original: 'Close Side Bar' },
category: CATEGORIES.View,
f1: true
});
@@ -51,7 +51,7 @@ registerAction2(CloseSidebarAction);
export class ToggleActivityBarVisibilityAction extends Action2 {
static readonly ID = 'workbench.action.toggleActivityBarVisibility';
static readonly LABEL = nls.localize('toggleActivityBar', "Toggle Activity Bar Visibility");
static readonly LABEL = localize('toggleActivityBar', "Toggle Activity Bar Visibility");
private static readonly activityBarVisibleKey = 'workbench.activityBar.visible';
@@ -81,7 +81,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: ToggleActivityBarVisibilityAction.ID,
title: nls.localize({ key: 'miShowActivityBar', comment: ['&& denotes a mnemonic'] }, "Show &&Activity Bar"),
title: localize({ key: 'miShowActivityBar', comment: ['&& denotes a mnemonic'] }, "Show &&Activity Bar"),
toggled: ContextKeyExpr.equals('config.workbench.activityBar.visible', true)
},
order: 4
@@ -96,7 +96,7 @@ class ToggleCenteredLayout extends Action2 {
constructor() {
super({
id: ToggleCenteredLayout.ID,
title: { value: nls.localize('toggleCenteredLayout', "Toggle Centered Layout"), original: 'Toggle Centered Layout' },
title: { value: localize('toggleCenteredLayout', "Toggle Centered Layout"), original: 'Toggle Centered Layout' },
category: CATEGORIES.View,
f1: true
});
@@ -115,7 +115,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '1_toggle_view',
command: {
id: ToggleCenteredLayout.ID,
title: nls.localize({ key: 'miToggleCenteredLayout', comment: ['&& denotes a mnemonic'] }, "&&Centered Layout"),
title: localize({ key: 'miToggleCenteredLayout', comment: ['&& denotes a mnemonic'] }, "&&Centered Layout"),
toggled: IsCenteredLayoutContext
},
order: 3
@@ -126,7 +126,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
export class ToggleSidebarPositionAction extends Action {
static readonly ID = 'workbench.action.toggleSidebarPosition';
static readonly LABEL = nls.localize('toggleSidebarPosition', "Toggle Side Bar Position");
static readonly LABEL = localize('toggleSidebarPosition', "Toggle Side Bar Position");
private static readonly sidebarPositionConfigurationKey = 'workbench.sideBar.location';
@@ -147,7 +147,7 @@ export class ToggleSidebarPositionAction extends Action {
}
static getLabel(layoutService: IWorkbenchLayoutService): string {
return layoutService.getSideBarPosition() === Position.LEFT ? nls.localize('moveSidebarRight', "Move Side Bar Right") : nls.localize('moveSidebarLeft', "Move Side Bar Left");
return layoutService.getSideBarPosition() === Position.LEFT ? localize('moveSidebarRight', "Move Side Bar Right") : localize('moveSidebarLeft', "Move Side Bar Left");
}
}
@@ -155,7 +155,7 @@ registerAction2(class extends Action2 {
constructor() {
super({
id: ToggleSidebarPositionAction.ID,
title: { value: nls.localize('toggleSidebarPosition', "Toggle Side Bar Position"), original: 'Toggle Side Bar Position' },
title: { value: localize('toggleSidebarPosition', "Toggle Side Bar Position"), original: 'Toggle Side Bar Position' },
category: CATEGORIES.View,
f1: true
});
@@ -170,7 +170,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize('move sidebar right', "Move Side Bar Right")
title: localize('move sidebar right', "Move Side Bar Right")
},
when: ContextKeyExpr.and(ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
@@ -181,7 +181,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize('move sidebar right', "Move Side Bar Right")
title: localize('move sidebar right', "Move Side Bar Right")
},
when: ContextKeyExpr.and(ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
@@ -192,7 +192,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize('move sidebar left', "Move Side Bar Left")
title: localize('move sidebar left', "Move Side Bar Left")
},
when: ContextKeyExpr.and(ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
@@ -203,7 +203,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize('move sidebar left', "Move Side Bar Left")
title: localize('move sidebar left', "Move Side Bar Left")
},
when: ContextKeyExpr.and(ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'), ContextKeyExpr.equals('viewLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 1
@@ -214,7 +214,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Right")
title: localize({ key: 'miMoveSidebarRight', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Right")
},
when: ContextKeyExpr.notEquals('config.workbench.sideBar.location', 'right'),
order: 2
@@ -224,7 +224,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '3_workbench_layout_move',
command: {
id: ToggleSidebarPositionAction.ID,
title: nls.localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left")
title: localize({ key: 'miMoveSidebarLeft', comment: ['&& denotes a mnemonic'] }, "&&Move Side Bar Left")
},
when: ContextKeyExpr.equals('config.workbench.sideBar.location', 'right'),
order: 2
@@ -234,7 +234,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
export class ToggleEditorVisibilityAction extends Action {
static readonly ID = 'workbench.action.toggleEditorVisibility';
static readonly LABEL = nls.localize('toggleEditor', "Toggle Editor Area Visibility");
static readonly LABEL = localize('toggleEditor', "Toggle Editor Area Visibility");
constructor(
id: string,
@@ -255,7 +255,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: ToggleEditorVisibilityAction.ID,
title: nls.localize({ key: 'miShowEditorArea', comment: ['&& denotes a mnemonic'] }, "Show &&Editor Area"),
title: localize({ key: 'miShowEditorArea', comment: ['&& denotes a mnemonic'] }, "Show &&Editor Area"),
toggled: EditorAreaVisibleContext
},
order: 5
@@ -263,7 +263,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
group: '2_appearance',
title: nls.localize({ key: 'miAppearance', comment: ['&& denotes a mnemonic'] }, "&&Appearance"),
title: localize({ key: 'miAppearance', comment: ['&& denotes a mnemonic'] }, "&&Appearance"),
submenu: MenuId.MenubarAppearanceMenu,
order: 1
});
@@ -273,7 +273,7 @@ registerAction2(class extends Action2 {
constructor() {
super({
id: TOGGLE_SIDEBAR_VISIBILITY_ACTION_ID,
title: { value: nls.localize('toggleSidebar', "Toggle Side Bar Visibility"), original: 'Toggle Side Bar Visibility' },
title: { value: localize('toggleSidebar', "Toggle Side Bar Visibility"), original: 'Toggle Side Bar Visibility' },
category: CATEGORIES.View,
f1: true,
keybinding: {
@@ -293,7 +293,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: TOGGLE_SIDEBAR_VISIBILITY_ACTION_ID,
title: nls.localize('compositePart.hideSideBarLabel', "Hide Side Bar"),
title: localize('compositePart.hideSideBarLabel', "Hide Side Bar"),
},
when: ContextKeyExpr.and(SideBarVisibleContext, ContextKeyExpr.equals('viewContainerLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 2
@@ -304,7 +304,7 @@ MenuRegistry.appendMenuItems([{
group: '3_workbench_layout_move',
command: {
id: TOGGLE_SIDEBAR_VISIBILITY_ACTION_ID,
title: nls.localize('compositePart.hideSideBarLabel', "Hide Side Bar"),
title: localize('compositePart.hideSideBarLabel', "Hide Side Bar"),
},
when: ContextKeyExpr.and(SideBarVisibleContext, ContextKeyExpr.equals('viewLocation', ViewContainerLocationToString(ViewContainerLocation.Sidebar))),
order: 2
@@ -315,7 +315,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: TOGGLE_SIDEBAR_VISIBILITY_ACTION_ID,
title: nls.localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "Show &&Side Bar"),
title: localize({ key: 'miShowSidebar', comment: ['&& denotes a mnemonic'] }, "Show &&Side Bar"),
toggled: SideBarVisibleContext
},
order: 1
@@ -326,7 +326,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
export class ToggleStatusbarVisibilityAction extends Action {
static readonly ID = 'workbench.action.toggleStatusbarVisibility';
static readonly LABEL = nls.localize('toggleStatusbar', "Toggle Status Bar Visibility");
static readonly LABEL = localize('toggleStatusbar', "Toggle Status Bar Visibility");
private static readonly statusbarVisibleKey = 'workbench.statusBar.visible';
@@ -353,7 +353,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: ToggleStatusbarVisibilityAction.ID,
title: nls.localize({ key: 'miShowStatusbar', comment: ['&& denotes a mnemonic'] }, "Show S&&tatus Bar"),
title: localize({ key: 'miShowStatusbar', comment: ['&& denotes a mnemonic'] }, "Show S&&tatus Bar"),
toggled: ContextKeyExpr.equals('config.workbench.statusBar.visible', true)
},
order: 3
@@ -364,7 +364,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
class ToggleTabsVisibilityAction extends Action {
static readonly ID = 'workbench.action.toggleTabsVisibility';
static readonly LABEL = nls.localize('toggleTabs', "Toggle Tab Visibility");
static readonly LABEL = localize('toggleTabs', "Toggle Tab Visibility");
private static readonly tabsVisibleKey = 'workbench.editor.showTabs';
@@ -395,7 +395,7 @@ registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleTabsVisibilityA
class ToggleZenMode extends Action {
static readonly ID = 'workbench.action.toggleZenMode';
static readonly LABEL = nls.localize('toggleZenMode', "Toggle Zen Mode");
static readonly LABEL = localize('toggleZenMode', "Toggle Zen Mode");
constructor(
id: string,
@@ -416,7 +416,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '1_toggle_view',
command: {
id: ToggleZenMode.ID,
title: nls.localize('miToggleZenMode', "Zen Mode"),
title: localize('miToggleZenMode', "Zen Mode"),
toggled: InEditorZenModeContext
},
order: 2
@@ -438,7 +438,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
export class ToggleMenuBarAction extends Action {
static readonly ID = 'workbench.action.toggleMenuBar';
static readonly LABEL = nls.localize('toggleMenuBar', "Toggle Menu Bar");
static readonly LABEL = localize('toggleMenuBar', "Toggle Menu Bar");
constructor(
id: string,
@@ -461,8 +461,8 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: ToggleMenuBarAction.ID,
title: nls.localize({ key: 'miShowMenuBar', comment: ['&& denotes a mnemonic'] }, "Show Menu &&Bar"),
toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle'))
title: localize({ key: 'miShowMenuBar', comment: ['&& denotes a mnemonic'] }, "Show Menu &&Bar"),
toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'compact'))
},
when: IsMacNativeContext.toNegated(),
order: 0
@@ -472,7 +472,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
export class ResetViewLocationsAction extends Action {
static readonly ID = 'workbench.action.resetViewLocations';
static readonly LABEL = nls.localize('resetViewLocations', "Reset View Locations");
static readonly LABEL = localize('resetViewLocations', "Reset View Locations");
constructor(
id: string,
@@ -489,40 +489,10 @@ export class ResetViewLocationsAction extends Action {
registry.registerWorkbenchAction(SyncActionDescriptor.from(ResetViewLocationsAction), 'View: Reset View Locations', CATEGORIES.View.value);
// --- Toggle View with Command
export class ToggleViewAction extends Action {
constructor(
id: string,
label: string,
private readonly viewId: string,
@IViewsService protected viewsService: IViewsService,
@IViewDescriptorService protected viewDescriptorService: IViewDescriptorService,
@IContextKeyService protected contextKeyService: IContextKeyService,
@IWorkbenchLayoutService private layoutService: IWorkbenchLayoutService,
) {
super(id, label);
}
async run(): Promise<void> {
const focusedViewId = FocusedViewContext.getValue(this.contextKeyService);
if (focusedViewId === this.viewId) {
if (this.viewDescriptorService.getViewLocationById(this.viewId) === ViewContainerLocation.Sidebar) {
this.layoutService.setSideBarHidden(true);
} else {
this.layoutService.setPanelHidden(true);
}
} else {
this.viewsService.openView(this.viewId, true);
}
}
}
// --- Move View with Command
export class MoveViewAction extends Action {
static readonly ID = 'workbench.action.moveView';
static readonly LABEL = nls.localize('moveView', "Move View");
static readonly LABEL = localize('moveView', "Move View");
constructor(
id: string,
@@ -551,7 +521,7 @@ export class MoveViewAction extends Action {
if (!hasAddedView) {
results.push({
type: 'separator',
label: nls.localize('sidebarContainer', "Side Bar / {0}", containerModel.title)
label: localize('sidebarContainer', "Side Bar / {0}", containerModel.title)
});
hasAddedView = true;
}
@@ -575,7 +545,7 @@ export class MoveViewAction extends Action {
if (!hasAddedView) {
results.push({
type: 'separator',
label: nls.localize('panelContainer', "Panel / {0}", containerModel.title)
label: localize('panelContainer', "Panel / {0}", containerModel.title)
});
hasAddedView = true;
}
@@ -593,7 +563,7 @@ export class MoveViewAction extends Action {
private async getView(viewId?: string): Promise<string> {
const quickPick = this.quickInputService.createQuickPick();
quickPick.placeholder = nls.localize('moveFocusedView.selectView', "Select a View to Move");
quickPick.placeholder = localize('moveFocusedView.selectView', "Select a View to Move");
quickPick.items = this.getViewItems();
quickPick.selectedItems = quickPick.items.filter(item => (item as IQuickPickItem).id === viewId) as IQuickPickItem[];
@@ -638,7 +608,7 @@ registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveViewAction), 'Vie
// --- Move Focused View with Command
export class MoveFocusedViewAction extends Action {
static readonly ID = 'workbench.action.moveFocusedView';
static readonly LABEL = nls.localize('moveFocusedView', "Move Focused View");
static readonly LABEL = localize('moveFocusedView', "Move Focused View");
constructor(
id: string,
@@ -658,19 +628,19 @@ export class MoveFocusedViewAction extends Action {
const focusedViewId = viewId || FocusedViewContext.getValue(this.contextKeyService);
if (focusedViewId === undefined || focusedViewId.trim() === '') {
this.notificationService.error(nls.localize('moveFocusedView.error.noFocusedView', "There is no view currently focused."));
this.notificationService.error(localize('moveFocusedView.error.noFocusedView', "There is no view currently focused."));
return;
}
const viewDescriptor = this.viewDescriptorService.getViewDescriptorById(focusedViewId);
if (!viewDescriptor || !viewDescriptor.canMoveView) {
this.notificationService.error(nls.localize('moveFocusedView.error.nonMovableView', "The currently focused view is not movable."));
this.notificationService.error(localize('moveFocusedView.error.nonMovableView', "The currently focused view is not movable."));
return;
}
const quickPick = this.quickInputService.createQuickPick();
quickPick.placeholder = nls.localize('moveFocusedView.selectDestination', "Select a Destination for the View");
quickPick.title = nls.localize({ key: 'moveFocusedView.title', comment: ['{0} indicates the title of the view the user has selected to move.'] }, "View: Move {0}", viewDescriptor.name);
quickPick.placeholder = localize('moveFocusedView.selectDestination', "Select a Destination for the View");
quickPick.title = localize({ key: 'moveFocusedView.title', comment: ['{0} indicates the title of the view the user has selected to move.'] }, "View: Move {0}", viewDescriptor.name);
const items: Array<IQuickPickItem | IQuickPickSeparator> = [];
const currentContainer = this.viewDescriptorService.getViewContainerByViewId(focusedViewId)!;
@@ -680,20 +650,20 @@ export class MoveFocusedViewAction extends Action {
if (!(isViewSolo && currentLocation === ViewContainerLocation.Panel)) {
items.push({
id: '_.panel.newcontainer',
label: nls.localize({ key: 'moveFocusedView.newContainerInPanel', comment: ['Creates a new top-level tab in the panel.'] }, "New Panel Entry"),
label: localize({ key: 'moveFocusedView.newContainerInPanel', comment: ['Creates a new top-level tab in the panel.'] }, "New Panel Entry"),
});
}
if (!(isViewSolo && currentLocation === ViewContainerLocation.Sidebar)) {
items.push({
id: '_.sidebar.newcontainer',
label: nls.localize('moveFocusedView.newContainerInSidebar', "New Side Bar Entry")
label: localize('moveFocusedView.newContainerInSidebar', "New Side Bar Entry")
});
}
items.push({
type: 'separator',
label: nls.localize('sidebar', "Side Bar")
label: localize('sidebar', "Side Bar")
});
const pinnedViewlets = this.activityBarService.getVisibleViewContainerIds();
@@ -708,13 +678,13 @@ export class MoveFocusedViewAction extends Action {
.map(viewletId => {
return {
id: viewletId,
label: this.viewDescriptorService.getViewContainerById(viewletId)!.name
label: this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerById(viewletId)!)!.title
};
}));
items.push({
type: 'separator',
label: nls.localize('panel', "Panel")
label: localize('panel', "Panel")
});
const pinnedPanels = this.panelService.getPinnedPanels();
@@ -729,7 +699,7 @@ export class MoveFocusedViewAction extends Action {
.map(panel => {
return {
id: panel.id,
label: this.viewDescriptorService.getViewContainerById(panel.id)!.name
label: this.viewDescriptorService.getViewContainerModel(this.viewDescriptorService.getViewContainerById(panel.id)!)!.title
};
}));
@@ -761,7 +731,7 @@ registry.registerWorkbenchAction(SyncActionDescriptor.from(MoveFocusedViewAction
// --- Reset View Location with Command
export class ResetFocusedViewLocationAction extends Action {
static readonly ID = 'workbench.action.resetFocusedViewLocation';
static readonly LABEL = nls.localize('resetFocusedViewLocation', "Reset Focused View Location");
static readonly LABEL = localize('resetFocusedViewLocation', "Reset Focused View Location");
constructor(
id: string,
@@ -783,7 +753,7 @@ export class ResetFocusedViewLocationAction extends Action {
}
if (!viewDescriptor) {
this.notificationService.error(nls.localize('resetFocusedView.error.noFocusedView', "There is no view currently focused."));
this.notificationService.error(localize('resetFocusedView.error.noFocusedView', "There is no view currently focused."));
return;
}
@@ -837,7 +807,7 @@ export class IncreaseViewSizeAction extends BaseResizeViewAction {
constructor() {
super({
id: 'workbench.action.increaseViewSize',
title: { value: nls.localize('increaseViewSize', "Increase Current View Size"), original: 'Increase Current View Size' },
title: { value: localize('increaseViewSize', "Increase Current View Size"), original: 'Increase Current View Size' },
f1: true
});
}
@@ -852,7 +822,7 @@ export class IncreaseViewWidthAction extends BaseResizeViewAction {
constructor() {
super({
id: 'workbench.action.increaseViewWidth',
title: { value: nls.localize('increaseEditorWidth', "Increase Editor Width"), original: 'Increase Editor Width' },
title: { value: localize('increaseEditorWidth', "Increase Editor Width"), original: 'Increase Editor Width' },
f1: true
});
}
@@ -867,7 +837,7 @@ export class IncreaseViewHeightAction extends BaseResizeViewAction {
constructor() {
super({
id: 'workbench.action.increaseViewHeight',
title: { value: nls.localize('increaseEditorHeight', "Increase Editor Height"), original: 'Increase Editor Height' },
title: { value: localize('increaseEditorHeight', "Increase Editor Height"), original: 'Increase Editor Height' },
f1: true
});
}
@@ -881,7 +851,7 @@ export class DecreaseViewSizeAction extends BaseResizeViewAction {
constructor() {
super({
id: 'workbench.action.decreaseViewSize',
title: { value: nls.localize('decreaseViewSize', "Decrease Current View Size"), original: 'Decrease Current View Size' },
title: { value: localize('decreaseViewSize', "Decrease Current View Size"), original: 'Decrease Current View Size' },
f1: true
});
}
@@ -895,7 +865,7 @@ export class DecreaseViewWidthAction extends BaseResizeViewAction {
constructor() {
super({
id: 'workbench.action.decreaseViewWidth',
title: { value: nls.localize('decreaseEditorWidth', "Decrease Editor Width"), original: 'Decrease Editor Width' },
title: { value: localize('decreaseEditorWidth', "Decrease Editor Width"), original: 'Decrease Editor Width' },
f1: true
});
}
@@ -911,7 +881,7 @@ export class DecreaseViewHeightAction extends BaseResizeViewAction {
constructor() {
super({
id: 'workbench.action.decreaseViewHeight',
title: { value: nls.localize('decreaseEditorHeight', "Decrease Editor Height"), original: 'Decrease Editor Height' },
title: { value: localize('decreaseEditorHeight', "Decrease Editor Height"), original: 'Decrease Editor Height' },
f1: true
});
}

View File

@@ -7,7 +7,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { KeybindingsRegistry, KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
import { List } from 'vs/base/browser/ui/list/listWidget';
import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, getSelectionKeyboardEvent } from 'vs/platform/list/browser/listService';
import { WorkbenchListFocusContextKey, IListService, WorkbenchListSupportsMultiSelectContextKey, ListWidget, WorkbenchListHasSelectionOrFocus, getSelectionKeyboardEvent, WorkbenchListWidget } from 'vs/platform/list/browser/listService';
import { PagedList } from 'vs/base/browser/ui/list/listPaging';
import { range } from 'vs/base/common/arrays';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
@@ -16,6 +16,7 @@ import { AsyncDataTree } from 'vs/base/browser/ui/tree/asyncDataTree';
import { DataTree } from 'vs/base/browser/ui/tree/dataTree';
import { ITreeNode } from 'vs/base/browser/ui/tree/tree';
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
import { Table } from 'vs/base/browser/ui/table/tableWidget';
function ensureDOMFocus(widget: ListWidget | undefined): void {
// it can happen that one of the commands is executed while
@@ -32,7 +33,7 @@ function focusDown(accessor: ServicesAccessor, arg2?: number, loop: boolean = fa
const count = typeof arg2 === 'number' ? arg2 : 1;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
list.focusNext(count);
@@ -71,10 +72,10 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
handler: (accessor, arg2) => focusDown(accessor, arg2)
});
function expandMultiSelection(focused: List<unknown> | PagedList<unknown> | ObjectTree<unknown, unknown> | DataTree<unknown, unknown, unknown> | AsyncDataTree<unknown, unknown, unknown>, previousFocus: unknown): void {
function expandMultiSelection(focused: WorkbenchListWidget, previousFocus: unknown): void {
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
const focus = list.getFocus() ? list.getFocus()[0] : undefined;
@@ -118,7 +119,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// List / Tree
if (focused instanceof List || focused instanceof PagedList || focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table || focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
const list = focused;
// Focus down first
@@ -136,7 +137,7 @@ function focusUp(accessor: ServicesAccessor, arg2?: number, loop: boolean = fals
const count = typeof arg2 === 'number' ? arg2 : 1;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
list.focusPrevious(count);
@@ -184,7 +185,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// List / Tree
if (focused instanceof List || focused instanceof PagedList || focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table || focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
const list = focused;
// Focus up first
@@ -210,7 +211,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// Tree only
if (focused && !(focused instanceof List || focused instanceof PagedList)) {
if (focused && !(focused instanceof List || focused instanceof PagedList || focused instanceof Table)) {
if (focused instanceof ObjectTree || focused instanceof DataTree || focused instanceof AsyncDataTree) {
const tree = focused;
const focusedElements = tree.getFocus();
@@ -245,10 +246,10 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
secondary: [KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.UpArrow]
},
handler: (accessor) => {
const focusedTree = accessor.get(IListService).lastFocusedList;
const focused = accessor.get(IListService).lastFocusedList;
if (focusedTree && !(focusedTree instanceof List || focusedTree instanceof PagedList)) {
focusedTree.collapseAll();
if (focused && !(focused instanceof List || focused instanceof PagedList || focused instanceof Table)) {
focused.collapseAll();
}
}
});
@@ -261,7 +262,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
handler: (accessor) => {
const focused = accessor.get(IListService).lastFocusedList;
if (!focused || focused instanceof List || focused instanceof PagedList) {
if (!focused || focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
return;
}
@@ -291,7 +292,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// Tree only
if (focused && !(focused instanceof List || focused instanceof PagedList)) {
if (focused && !(focused instanceof List || focused instanceof PagedList || focused instanceof Table)) {
if (focused instanceof ObjectTree || focused instanceof DataTree) {
// TODO@Joao: instead of doing this here, just delegate to a tree method
const tree = focused;
@@ -355,7 +356,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
focused.focusPreviousPage();
}
@@ -379,7 +380,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
focused.focusNextPage();
}
@@ -414,7 +415,7 @@ function listFocusFirst(accessor: ServicesAccessor, options?: { fromFocused: boo
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
list.setFocus([0]);
@@ -458,7 +459,7 @@ function listFocusLast(accessor: ServicesAccessor, options?: { fromFocused: bool
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
list.setFocus([list.length - 1]);
@@ -487,7 +488,7 @@ function focusElement(accessor: ServicesAccessor, retainCurrentFocus: boolean):
const focused = accessor.get(IListService).lastFocusedList;
const fakeKeyboardEvent = getSelectionKeyboardEvent('keydown', retainCurrentFocus);
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
list.setSelection(list.getFocus(), fakeKeyboardEvent);
}
@@ -546,7 +547,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
const fakeKeyboardEvent = new KeyboardEvent('keydown');
list.setSelection(range(list.length), fakeKeyboardEvent);
@@ -666,7 +667,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
list.setSelection([]);
@@ -690,7 +691,7 @@ CommandsRegistry.registerCommand({
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
const list = focused;
list.toggleKeyboardNavigation();
}
@@ -709,7 +710,7 @@ CommandsRegistry.registerCommand({
const focused = accessor.get(IListService).lastFocusedList;
// List
if (focused instanceof List || focused instanceof PagedList) {
if (focused instanceof List || focused instanceof PagedList || focused instanceof Table) {
// TODO@joao
}

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { Registry } from 'vs/platform/registry/common/platform';
import { Action } from 'vs/base/common/actions';
import { IEditorGroupsService, GroupDirection, GroupLocation, IFindGroupScope } from 'vs/workbench/services/editor/common/editorGroupsService';
@@ -137,7 +137,7 @@ abstract class BaseNavigationAction extends Action {
class NavigateLeftAction extends BaseNavigationAction {
static readonly ID = 'workbench.action.navigateLeft';
static readonly LABEL = nls.localize('navigateLeft', "Navigate to the View on the Left");
static readonly LABEL = localize('navigateLeft', "Navigate to the View on the Left");
constructor(
id: string,
@@ -154,7 +154,7 @@ class NavigateLeftAction extends BaseNavigationAction {
class NavigateRightAction extends BaseNavigationAction {
static readonly ID = 'workbench.action.navigateRight';
static readonly LABEL = nls.localize('navigateRight', "Navigate to the View on the Right");
static readonly LABEL = localize('navigateRight', "Navigate to the View on the Right");
constructor(
id: string,
@@ -171,7 +171,7 @@ class NavigateRightAction extends BaseNavigationAction {
class NavigateUpAction extends BaseNavigationAction {
static readonly ID = 'workbench.action.navigateUp';
static readonly LABEL = nls.localize('navigateUp', "Navigate to the View Above");
static readonly LABEL = localize('navigateUp', "Navigate to the View Above");
constructor(
id: string,
@@ -188,7 +188,7 @@ class NavigateUpAction extends BaseNavigationAction {
class NavigateDownAction extends BaseNavigationAction {
static readonly ID = 'workbench.action.navigateDown';
static readonly LABEL = nls.localize('navigateDown', "Navigate to the View Below");
static readonly LABEL = localize('navigateDown', "Navigate to the View Below");
constructor(
id: string,
@@ -214,7 +214,9 @@ function findVisibleNeighbour(layoutService: IWorkbenchLayoutService, part: Part
}
function focusNextOrPreviousPart(layoutService: IWorkbenchLayoutService, editorService: IEditorService, next: boolean): void {
const editorFocused = editorService.activeEditorPane?.hasFocus();
// Need to ask if the active editor has focus since the layoutService is not aware of some custom editor focus behavior(notebooks)
// Also need to ask the layoutService for the case if no editor is opened
const editorFocused = editorService.activeEditorPane?.hasFocus() || layoutService.hasFocus(Parts.EDITOR_PART);
const currentlyFocusedPart = editorFocused ? Parts.EDITOR_PART : layoutService.hasFocus(Parts.ACTIVITYBAR_PART) ? Parts.ACTIVITYBAR_PART :
layoutService.hasFocus(Parts.STATUSBAR_PART) ? Parts.STATUSBAR_PART : layoutService.hasFocus(Parts.SIDEBAR_PART) ? Parts.SIDEBAR_PART : layoutService.hasFocus(Parts.PANEL_PART) ? Parts.PANEL_PART : undefined;
let partToFocus = Parts.EDITOR_PART;
@@ -227,7 +229,7 @@ function focusNextOrPreviousPart(layoutService: IWorkbenchLayoutService, editorS
export class FocusNextPart extends Action {
static readonly ID = 'workbench.action.focusNextPart';
static readonly LABEL = nls.localize('focusNextPart', "Focus Next Part");
static readonly LABEL = localize('focusNextPart', "Focus Next Part");
constructor(
id: string,
@@ -245,7 +247,7 @@ export class FocusNextPart extends Action {
export class FocusPreviousPart extends Action {
static readonly ID = 'workbench.action.focusPreviousPart';
static readonly LABEL = nls.localize('focusPreviousPart', "Focus Previous Part");
static readonly LABEL = localize('focusPreviousPart', "Focus Previous Part");
constructor(
id: string,

View File

@@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { Action } from 'vs/base/common/actions';
import { IWindowOpenable } from 'vs/platform/windows/common/windows';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
@@ -46,18 +46,18 @@ abstract class BaseOpenRecentAction extends Action {
private readonly removeFromRecentlyOpened: IQuickInputButton = {
iconClass: Codicon.removeClose.classNames,
tooltip: nls.localize('remove', "Remove from Recently Opened")
tooltip: localize('remove', "Remove from Recently Opened")
};
private readonly dirtyRecentlyOpenedFolder: IQuickInputButton = {
iconClass: 'dirty-workspace ' + Codicon.closeDirty.classNames,
tooltip: nls.localize('dirtyRecentlyOpenedFolder', "Folder With Unsaved Files"),
tooltip: localize('dirtyRecentlyOpenedFolder', "Folder With Unsaved Files"),
alwaysVisible: true
};
private readonly dirtyRecentlyOpenedWorkspace: IQuickInputButton = {
...this.dirtyRecentlyOpenedFolder,
tooltip: nls.localize('dirtyRecentlyOpenedWorkspace', "Workspace With Unsaved Files"),
tooltip: localize('dirtyRecentlyOpenedWorkspace', "Workspace With Unsaved Files"),
};
constructor(
@@ -133,14 +133,14 @@ abstract class BaseOpenRecentAction extends Action {
let keyMods: IKeyMods | undefined;
const workspaceSeparator: IQuickPickSeparator = { type: 'separator', label: hasWorkspaces ? nls.localize('workspacesAndFolders', "folders & workspaces") : nls.localize('folders', "folders") };
const fileSeparator: IQuickPickSeparator = { type: 'separator', label: nls.localize('files', "files") };
const workspaceSeparator: IQuickPickSeparator = { type: 'separator', label: hasWorkspaces ? localize('workspacesAndFolders', "folders & workspaces") : localize('folders', "folders") };
const fileSeparator: IQuickPickSeparator = { type: 'separator', label: localize('files', "files") };
const picks = [workspaceSeparator, ...workspacePicks, fileSeparator, ...filePicks];
const pick = await this.quickInputService.pick(picks, {
contextKey: inRecentFilesPickerContextKey,
activeItem: [...workspacePicks, ...filePicks][autoFocusSecondEntry ? 1 : 0],
placeHolder: isMacintosh ? nls.localize('openRecentPlaceholderMac', "Select to open (hold Cmd-key to force new window or Alt-key for same window)") : nls.localize('openRecentPlaceholder', "Select to open (hold Ctrl-key to force new window or Alt-key for same window)"),
placeHolder: isMacintosh ? localize('openRecentPlaceholderMac', "Select to open (hold Cmd-key to force new window or Alt-key for same window)") : localize('openRecentPlaceholder', "Select to open (hold Ctrl-key to force new window or Alt-key for same window)"),
matchOnDescription: true,
onKeyMods: mods => keyMods = mods,
quickNavigate: this.isQuickNavigate() ? { keybindings: this.keybindingService.lookupKeybindings(this.id) } : undefined,
@@ -157,9 +157,9 @@ abstract class BaseOpenRecentAction extends Action {
const isDirtyWorkspace = context.button === this.dirtyRecentlyOpenedWorkspace;
const result = await this.dialogService.confirm({
type: 'question',
title: isDirtyWorkspace ? nls.localize('dirtyWorkspace', "Workspace with Unsaved Files") : nls.localize('dirtyFolder', "Folder with Unsaved Files"),
message: isDirtyWorkspace ? nls.localize('dirtyWorkspaceConfirm', "Do you want to open the workspace to review the unsaved files?") : nls.localize('dirtyFolderConfirm', "Do you want to open the folder to review the unsaved files?"),
detail: isDirtyWorkspace ? nls.localize('dirtyWorkspaceConfirmDetail', "Workspaces with unsaved files cannot be removed until all unsaved files have been saved or reverted.") : nls.localize('dirtyFolderConfirmDetail', "Folders with unsaved files cannot be removed until all unsaved files have been saved or reverted.")
title: isDirtyWorkspace ? localize('dirtyWorkspace', "Workspace with Unsaved Files") : localize('dirtyFolder', "Folder with Unsaved Files"),
message: isDirtyWorkspace ? localize('dirtyWorkspaceConfirm', "Do you want to open the workspace to review the unsaved files?") : localize('dirtyFolderConfirm', "Do you want to open the folder to review the unsaved files?"),
detail: isDirtyWorkspace ? localize('dirtyWorkspaceConfirmDetail', "Workspaces with unsaved files cannot be removed until all unsaved files have been saved or reverted.") : localize('dirtyFolderConfirmDetail', "Folders with unsaved files cannot be removed until all unsaved files have been saved or reverted.")
});
if (result.confirmed) {
@@ -212,7 +212,7 @@ abstract class BaseOpenRecentAction extends Action {
return {
iconClasses,
label: name,
ariaLabel: isDirty ? isWorkspace ? nls.localize('recentDirtyWorkspaceAriaLabel', "{0}, workspace with unsaved changes", name) : nls.localize('recentDirtyFolderAriaLabel', "{0}, folder with unsaved changes", name) : name,
ariaLabel: isDirty ? isWorkspace ? localize('recentDirtyWorkspaceAriaLabel', "{0}, workspace with unsaved changes", name) : localize('recentDirtyFolderAriaLabel', "{0}, folder with unsaved changes", name) : name,
description: parentPath,
buttons: isDirty ? [isWorkspace ? this.dirtyRecentlyOpenedWorkspace : this.dirtyRecentlyOpenedFolder] : [this.removeFromRecentlyOpened],
openable,
@@ -224,7 +224,7 @@ abstract class BaseOpenRecentAction extends Action {
export class OpenRecentAction extends BaseOpenRecentAction {
static readonly ID = 'workbench.action.openRecent';
static readonly LABEL = nls.localize('openRecent', "Open Recent...");
static readonly LABEL = localize('openRecent', "Open Recent...");
constructor(
id: string,
@@ -250,7 +250,7 @@ export class OpenRecentAction extends BaseOpenRecentAction {
class QuickPickRecentAction extends BaseOpenRecentAction {
static readonly ID = 'workbench.action.quickOpenRecent';
static readonly LABEL = nls.localize('quickOpenRecent', "Quick Open Recent...");
static readonly LABEL = localize('quickOpenRecent', "Quick Open Recent...");
constructor(
id: string,
@@ -276,7 +276,7 @@ class QuickPickRecentAction extends BaseOpenRecentAction {
class ToggleFullScreenAction extends Action {
static readonly ID = 'workbench.action.toggleFullScreen';
static readonly LABEL = nls.localize('toggleFullScreen', "Toggle Full Screen");
static readonly LABEL = localize('toggleFullScreen', "Toggle Full Screen");
constructor(
id: string,
@@ -294,7 +294,7 @@ class ToggleFullScreenAction extends Action {
export class ReloadWindowAction extends Action {
static readonly ID = 'workbench.action.reloadWindow';
static readonly LABEL = nls.localize('reloadWindow', "Reload Window");
static readonly LABEL = localize('reloadWindow', "Reload Window");
constructor(
id: string,
@@ -314,7 +314,7 @@ export class ReloadWindowAction extends Action {
class ShowAboutDialogAction extends Action {
static readonly ID = 'workbench.action.showAboutDialog';
static readonly LABEL = nls.localize('about', "About");
static readonly LABEL = localize('about', "About");
constructor(
id: string,
@@ -332,7 +332,7 @@ class ShowAboutDialogAction extends Action {
export class NewWindowAction extends Action {
static readonly ID = 'workbench.action.newWindow';
static readonly LABEL = nls.localize('newWindow', "New Window");
static readonly LABEL = localize('newWindow', "New Window");
constructor(
id: string,
@@ -352,7 +352,7 @@ class BlurAction extends Action2 {
constructor() {
super({
id: 'workbench.action.blur',
title: nls.localize('blur', "Remove keyboard focus from focused element")
title: localize('blur', "Remove keyboard focus from focused element")
});
}
@@ -369,7 +369,7 @@ const registry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActio
// --- Actions Registration
const fileCategory = nls.localize('file', "File");
const fileCategory = localize('file', "File");
registry.registerWorkbenchAction(SyncActionDescriptor.from(NewWindowAction, { primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_N }), 'New Window');
registry.registerWorkbenchAction(SyncActionDescriptor.from(QuickPickRecentAction), 'File: Quick Open Recent...', fileCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(OpenRecentAction, { primary: KeyMod.CtrlCmd | KeyCode.KEY_R, mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_R } }), 'File: Open Recent...', fileCategory);
@@ -426,7 +426,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
group: 'z_ConfirmClose',
command: {
id: 'workbench.action.toggleConfirmBeforeClose',
title: nls.localize('miConfirmClose', "Confirm Before Close"),
title: localize('miConfirmClose', "Confirm Before Close"),
toggled: ContextKeyExpr.notEquals('config.window.confirmBeforeClose', 'never')
},
order: 1,
@@ -437,13 +437,13 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
group: '1_new',
command: {
id: NewWindowAction.ID,
title: nls.localize({ key: 'miNewWindow', comment: ['&& denotes a mnemonic'] }, "New &&Window")
title: localize({ key: 'miNewWindow', comment: ['&& denotes a mnemonic'] }, "New &&Window")
},
order: 2
});
MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
title: nls.localize({ key: 'miOpenRecent', comment: ['&& denotes a mnemonic'] }, "Open &&Recent"),
title: localize({ key: 'miOpenRecent', comment: ['&& denotes a mnemonic'] }, "Open &&Recent"),
submenu: MenuId.MenubarRecentMenu,
group: '2_open',
order: 4
@@ -453,7 +453,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarRecentMenu, {
group: 'y_more',
command: {
id: OpenRecentAction.ID,
title: nls.localize({ key: 'miMore', comment: ['&& denotes a mnemonic'] }, "&&More...")
title: localize({ key: 'miMore', comment: ['&& denotes a mnemonic'] }, "&&More...")
},
order: 1
});
@@ -462,7 +462,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '1_toggle_view',
command: {
id: ToggleFullScreenAction.ID,
title: nls.localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "&&Full Screen"),
title: localize({ key: 'miToggleFullScreen', comment: ['&& denotes a mnemonic'] }, "&&Full Screen"),
toggled: IsFullscreenContext
},
order: 1
@@ -472,7 +472,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarHelpMenu, {
group: 'z_about',
command: {
id: ShowAboutDialogAction.ID,
title: nls.localize({ key: 'miAbout', comment: ['&& denotes a mnemonic'] }, "&&About")
title: localize({ key: 'miAbout', comment: ['&& denotes a mnemonic'] }, "&&About")
},
order: 1,
when: IsMacNativeContext.toNegated()

View File

@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { Action } from 'vs/base/common/actions';
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { ITelemetryData } from 'vs/platform/telemetry/common/telemetry';
import { IWorkspaceContextService, WorkbenchState, IWorkspaceFolder } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing';
@@ -12,9 +12,9 @@ import { IEditorService } from 'vs/workbench/services/editor/common/editorServic
import { ICommandService, CommandsRegistry } from 'vs/platform/commands/common/commands';
import { ADD_ROOT_FOLDER_COMMAND_ID, ADD_ROOT_FOLDER_LABEL, PICK_WORKSPACE_FOLDER_COMMAND_ID } from 'vs/workbench/browser/actions/workspaceCommands';
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
import { MenuRegistry, MenuId, SyncActionDescriptor } from 'vs/platform/actions/common/actions';
import { MenuRegistry, MenuId, SyncActionDescriptor, Action2, registerAction2 } from 'vs/platform/actions/common/actions';
import { EmptyWorkspaceSupportContext, WorkbenchStateContext, WorkspaceFolderCountContext } from 'vs/workbench/browser/contextkeys';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { Registry } from 'vs/platform/registry/common/platform';
import { IWorkbenchActionRegistry, Extensions } from 'vs/workbench/common/actions';
import { INotificationService } from 'vs/platform/notification/common/notification';
@@ -23,11 +23,12 @@ import { KeyChord, KeyCode, KeyMod } from 'vs/base/common/keyCodes';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { IWorkspacesService, hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
import { WORKSPACE_TRUST_ENABLED } from 'vs/workbench/services/workspaces/common/workspaceTrust';
export class OpenFileAction extends Action {
static readonly ID = 'workbench.action.files.openFile';
static readonly LABEL = nls.localize('openFile', "Open File...");
static readonly LABEL = localize('openFile', "Open File...");
constructor(
id: string,
@@ -45,7 +46,7 @@ export class OpenFileAction extends Action {
export class OpenFolderAction extends Action {
static readonly ID = 'workbench.action.files.openFolder';
static readonly LABEL = nls.localize('openFolder', "Open Folder...");
static readonly LABEL = localize('openFolder', "Open Folder...");
constructor(
id: string,
@@ -63,7 +64,7 @@ export class OpenFolderAction extends Action {
export class OpenFileFolderAction extends Action {
static readonly ID = 'workbench.action.files.openFileFolder';
static readonly LABEL = nls.localize('openFileFolder', "Open...");
static readonly LABEL = localize('openFileFolder', "Open...");
constructor(
id: string,
@@ -81,7 +82,7 @@ export class OpenFileFolderAction extends Action {
export class OpenWorkspaceAction extends Action {
static readonly ID = 'workbench.action.openWorkspace';
static readonly LABEL = nls.localize('openWorkspaceAction', "Open Workspace...");
static readonly LABEL = localize('openWorkspaceAction', "Open Workspace...");
constructor(
id: string,
@@ -99,7 +100,7 @@ export class OpenWorkspaceAction extends Action {
export class CloseWorkspaceAction extends Action {
static readonly ID = 'workbench.action.closeFolder';
static readonly LABEL = nls.localize('closeWorkspace', "Close Workspace");
static readonly LABEL = localize('closeWorkspace', "Close Workspace");
constructor(
id: string,
@@ -114,7 +115,7 @@ export class CloseWorkspaceAction extends Action {
async run(): Promise<void> {
if (this.contextService.getWorkbenchState() === WorkbenchState.EMPTY) {
this.notificationService.info(nls.localize('noWorkspaceOrFolderOpened', "There is currently no workspace or folder opened in this instance to close."));
this.notificationService.info(localize('noWorkspaceOrFolderOpened', "There is currently no workspace or folder opened in this instance to close."));
return;
}
@@ -125,7 +126,7 @@ export class CloseWorkspaceAction extends Action {
export class OpenWorkspaceConfigFileAction extends Action {
static readonly ID = 'workbench.action.openWorkspaceConfigFile';
static readonly LABEL = nls.localize('openWorkspaceConfigFile', "Open Workspace Configuration File");
static readonly LABEL = localize('openWorkspaceConfigFile', "Open Workspace Configuration File");
constructor(
id: string,
@@ -167,7 +168,7 @@ export class AddRootFolderAction extends Action {
export class GlobalRemoveRootFolderAction extends Action {
static readonly ID = 'workbench.action.removeRootFolder';
static readonly LABEL = nls.localize('globalRemoveFolderFromWorkspace', "Remove Folder from Workspace...");
static readonly LABEL = localize('globalRemoveFolderFromWorkspace', "Remove Folder from Workspace...");
constructor(
id: string,
@@ -195,7 +196,7 @@ export class GlobalRemoveRootFolderAction extends Action {
export class SaveWorkspaceAsAction extends Action {
static readonly ID = 'workbench.action.saveWorkspaceAs';
static readonly LABEL = nls.localize('saveWorkspaceAsAction', "Save Workspace As...");
static readonly LABEL = localize('saveWorkspaceAsAction', "Save Workspace As...");
constructor(
id: string,
@@ -225,7 +226,7 @@ export class SaveWorkspaceAsAction extends Action {
export class DuplicateWorkspaceInNewWindowAction extends Action {
static readonly ID = 'workbench.action.duplicateWorkspaceInNewWindow';
static readonly LABEL = nls.localize('duplicateWorkspaceInNewWindow', "Duplicate As Workspace in New Window");
static readonly LABEL = localize('duplicateWorkspaceInNewWindow', "Duplicate As Workspace in New Window");
constructor(
id: string,
@@ -250,10 +251,29 @@ export class DuplicateWorkspaceInNewWindowAction extends Action {
}
}
class WorkspaceTrustManageAction extends Action2 {
constructor() {
super({
id: 'workbench.action.manageTrust',
title: { value: localize('manageTrustAction', "Manage Workspace Trust"), original: 'Manage Workspace Trust' },
precondition: ContextKeyExpr.equals(`config.${WORKSPACE_TRUST_ENABLED}`, true),
category: localize('workspacesCategory', "Workspaces"),
f1: true
});
}
async run(accessor: ServicesAccessor) {
const commandService = accessor.get(ICommandService);
await commandService.executeCommand('workbench.trust.manage');
}
}
registerAction2(WorkspaceTrustManageAction);
// --- Actions Registration
const registry = Registry.as<IWorkbenchActionRegistry>(Extensions.WorkbenchActions);
const workspacesCategory = nls.localize('workspaces', "Workspaces");
const workspacesCategory = localize('workspaces', "Workspaces");
registry.registerWorkbenchAction(SyncActionDescriptor.from(AddRootFolderAction), 'Workspaces: Add Folder to Workspace...', workspacesCategory);
registry.registerWorkbenchAction(SyncActionDescriptor.from(GlobalRemoveRootFolderAction), 'Workspaces: Remove Folder from Workspace...', workspacesCategory);
@@ -271,7 +291,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
group: '3_workspace',
command: {
id: ADD_ROOT_FOLDER_COMMAND_ID,
title: nls.localize({ key: 'miAddFolderToWorkspace', comment: ['&& denotes a mnemonic'] }, "A&&dd Folder to Workspace...")
title: localize({ key: 'miAddFolderToWorkspace', comment: ['&& denotes a mnemonic'] }, "A&&dd Folder to Workspace...")
},
order: 1
});
@@ -280,7 +300,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
group: '3_workspace',
command: {
id: SaveWorkspaceAsAction.ID,
title: nls.localize('miSaveWorkspaceAs', "Save Workspace As...")
title: localize('miSaveWorkspaceAs', "Save Workspace As...")
},
order: 2,
when: EmptyWorkspaceSupportContext
@@ -298,7 +318,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
group: '6_close',
command: {
id: CloseWorkspaceAction.ID,
title: nls.localize({ key: 'miCloseFolder', comment: ['&& denotes a mnemonic'] }, "Close &&Folder"),
title: localize({ key: 'miCloseFolder', comment: ['&& denotes a mnemonic'] }, "Close &&Folder"),
precondition: WorkspaceFolderCountContext.notEqualsTo('0')
},
order: 3,
@@ -309,7 +329,7 @@ MenuRegistry.appendMenuItem(MenuId.MenubarFileMenu, {
group: '6_close',
command: {
id: CloseWorkspaceAction.ID,
title: nls.localize({ key: 'miCloseWorkspace', comment: ['&& denotes a mnemonic'] }, "Close &&Workspace")
title: localize({ key: 'miCloseWorkspace', comment: ['&& denotes a mnemonic'] }, "Close &&Workspace")
},
order: 3,
when: ContextKeyExpr.and(WorkbenchStateContext.isEqualTo('workspace'), EmptyWorkspaceSupportContext)

View File

@@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as nls from 'vs/nls';
import { localize } from 'vs/nls';
import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace';
import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing';
import * as resources from 'vs/base/common/resources';
import { dirname, removeTrailingPathSeparator } from 'vs/base/common/resources';
import { CancellationToken } from 'vs/base/common/cancellation';
import { mnemonicButtonLabel } from 'vs/base/common/labels';
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
@@ -24,7 +24,7 @@ import { IOpenWindowOptions, IWindowOpenable } from 'vs/platform/windows/common/
import { hasWorkspaceFileExtension } from 'vs/platform/workspaces/common/workspaces';
export const ADD_ROOT_FOLDER_COMMAND_ID = 'addRootFolder';
export const ADD_ROOT_FOLDER_LABEL = nls.localize('addFolderToWorkspace', "Add Folder to Workspace...");
export const ADD_ROOT_FOLDER_LABEL = localize('addFolderToWorkspace', "Add Folder to Workspace...");
export const PICK_WORKSPACE_FOLDER_COMMAND_ID = '_workbench.pickWorkspaceFolder';
@@ -61,8 +61,8 @@ CommandsRegistry.registerCommand({
const workspaceEditingService = accessor.get(IWorkspaceEditingService);
const dialogsService = accessor.get(IFileDialogService);
const folders = await dialogsService.showOpenDialog({
openLabel: mnemonicButtonLabel(nls.localize({ key: 'add', comment: ['&& denotes a mnemonic'] }, "&&Add")),
title: nls.localize('addFolderToWorkspaceTitle', "Add Folder to Workspace"),
openLabel: mnemonicButtonLabel(localize({ key: 'add', comment: ['&& denotes a mnemonic'] }, "&&Add")),
title: localize('addFolderToWorkspaceTitle', "Add Folder to Workspace"),
canSelectFolders: true,
canSelectMany: true,
defaultUri: await dialogsService.defaultFolderPath()
@@ -72,7 +72,7 @@ CommandsRegistry.registerCommand({
return;
}
await workspaceEditingService.addFolders(folders.map(folder => ({ uri: resources.removeTrailingPathSeparator(folder) })));
await workspaceEditingService.addFolders(folders.map(folder => ({ uri: removeTrailingPathSeparator(folder) })));
}
});
@@ -91,7 +91,7 @@ CommandsRegistry.registerCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, async functio
const folderPicks: IQuickPickItem[] = folders.map(folder => {
return {
label: folder.name,
description: labelService.getUriLabel(resources.dirname(folder.uri), { relative: true }),
description: labelService.getUriLabel(dirname(folder.uri), { relative: true }),
folder,
iconClasses: getIconClasses(modelService, modeService, folder.uri, FileKind.ROOT_FOLDER)
};
@@ -104,7 +104,7 @@ CommandsRegistry.registerCommand(PICK_WORKSPACE_FOLDER_COMMAND_ID, async functio
}
if (!options.placeHolder) {
options.placeHolder = nls.localize('workspaceFolderPickerPlaceholder', "Select workspace folder");
options.placeHolder = localize('workspaceFolderPickerPlaceholder', "Select workspace folder");
}
if (typeof options.matchOnDescription !== 'boolean') {
@@ -159,7 +159,7 @@ CommandsRegistry.registerCommand({
description: 'Open a folder or workspace in the current window or new window depending on the newWindow argument. Note that opening in the same window will shutdown the current extension host process and start a new one on the given folder/workspace unless the newWindow parameter is set to true.',
args: [
{ name: 'uri', description: '(optional) Uri of the folder or workspace file to open. If not provided, a native dialog will ask the user for the folder', constraint: (value: any) => value === undefined || value instanceof URI },
{ name: 'options', description: '(optional) Options. Object with the following properties: `forceNewWindow `: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `noRecentEntry`: Wheter the opened URI will appear in the \'Open Recent\' list. Defaults to true. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.', constraint: (value: any) => value === undefined || typeof value === 'object' || typeof value === 'boolean' }
{ name: 'options', description: '(optional) Options. Object with the following properties: `forceNewWindow `: Whether to open the folder/workspace in a new window or the same. Defaults to opening in the same window. `noRecentEntry`: Whether the opened URI will appear in the \'Open Recent\' list. Defaults to true. Note, for backward compatibility, options can also be of type boolean, representing the `forceNewWindow` setting.', constraint: (value: any) => value === undefined || typeof value === 'object' || typeof value === 'boolean' }
]
}
});