@theia/core 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/color-registry.d.ts +3 -69
- package/lib/browser/color-registry.d.ts.map +1 -1
- package/lib/browser/color-registry.js +13 -27
- package/lib/browser/color-registry.js.map +1 -1
- package/lib/browser/common-frontend-contribution.d.ts +3 -3
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +64 -64
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/core-preferences.d.ts.map +1 -1
- package/lib/browser/core-preferences.js +23 -20
- package/lib/browser/core-preferences.js.map +1 -1
- package/lib/browser/dialogs.d.ts.map +1 -1
- package/lib/browser/dialogs.js +4 -4
- package/lib/browser/dialogs.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js +2 -2
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js +6 -4
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js.map +1 -1
- package/lib/browser/keyboard/keys.d.ts +2 -251
- package/lib/browser/keyboard/keys.d.ts.map +1 -1
- package/lib/browser/keyboard/keys.js +12 -614
- package/lib/browser/keyboard/keys.js.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.d.ts +3 -3
- package/lib/browser/messaging/ws-connection-provider.d.ts.map +1 -1
- package/lib/browser/messaging/ws-connection-provider.js +14 -4
- package/lib/browser/messaging/ws-connection-provider.js.map +1 -1
- package/lib/browser/quick-input/quick-command-frontend-contribution.js +1 -1
- package/lib/browser/quick-input/quick-command-frontend-contribution.js.map +1 -1
- package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-service.js +2 -2
- package/lib/browser/quick-input/quick-command-service.js.map +1 -1
- package/lib/browser/quick-input/quick-input-service.d.ts +1 -201
- package/lib/browser/quick-input/quick-input-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-input-service.js +11 -93
- package/lib/browser/quick-input/quick-input-service.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar.js +1 -1
- package/lib/browser/shell/tab-bar-toolbar.js.map +1 -1
- package/lib/browser/storage-service.spec.js +1 -1
- package/lib/browser/storage-service.spec.js.map +1 -1
- package/lib/browser/theming.d.ts +5 -14
- package/lib/browser/theming.d.ts.map +1 -1
- package/lib/browser/theming.js +14 -0
- package/lib/browser/theming.js.map +1 -1
- package/lib/browser/window/default-window-service.js +1 -1
- package/lib/browser/window/default-window-service.js.map +1 -1
- package/lib/browser/window-contribution.d.ts.map +1 -1
- package/lib/browser/window-contribution.js +2 -2
- package/lib/browser/window-contribution.js.map +1 -1
- package/lib/common/color.d.ts +84 -0
- package/lib/common/color.d.ts.map +1 -0
- package/lib/common/color.js +44 -0
- package/lib/common/color.js.map +1 -0
- package/lib/common/command.d.ts +1 -0
- package/lib/common/command.d.ts.map +1 -1
- package/lib/common/command.js +4 -0
- package/lib/common/command.js.map +1 -1
- package/lib/common/i18n/localization.d.ts +9 -0
- package/lib/common/i18n/localization.d.ts.map +1 -1
- package/lib/common/i18n/localization.js +13 -2
- package/lib/common/i18n/localization.js.map +1 -1
- package/lib/common/keys.d.ts +269 -0
- package/lib/common/keys.d.ts.map +1 -0
- package/lib/common/keys.js +634 -0
- package/lib/common/keys.js.map +1 -0
- package/lib/common/messaging/abstract-connection-provider.d.ts +1 -1
- package/lib/common/messaging/abstract-connection-provider.d.ts.map +1 -1
- package/lib/common/messaging/abstract-connection-provider.js +3 -1
- package/lib/common/messaging/abstract-connection-provider.js.map +1 -1
- package/lib/common/messaging/proxy-factory.js +1 -1
- package/lib/common/messaging/proxy-factory.js.map +1 -1
- package/lib/common/nls.d.ts +5 -0
- package/lib/common/nls.d.ts.map +1 -1
- package/lib/common/nls.js +62 -0
- package/lib/common/nls.js.map +1 -1
- package/lib/common/path.d.ts +6 -0
- package/lib/common/path.d.ts.map +1 -1
- package/lib/common/path.js +16 -4
- package/lib/common/path.js.map +1 -1
- package/lib/common/path.spec.js +12 -0
- package/lib/common/path.spec.js.map +1 -1
- package/lib/common/promise-util.d.ts +2 -2
- package/lib/common/promise-util.d.ts.map +1 -1
- package/lib/common/promise-util.js.map +1 -1
- package/lib/common/quick-pick-service.d.ts +219 -1
- package/lib/common/quick-pick-service.d.ts.map +1 -1
- package/lib/common/quick-pick-service.js +108 -1
- package/lib/common/quick-pick-service.js.map +1 -1
- package/lib/common/theme.d.ts +30 -0
- package/lib/common/theme.d.ts.map +1 -0
- package/lib/common/theme.js +18 -0
- package/lib/common/theme.js.map +1 -0
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js +17 -17
- package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
- package/lib/electron-browser/window/electron-window-preferences.js +2 -2
- package/lib/electron-browser/window/electron-window-preferences.js.map +1 -1
- package/package.json +5 -5
- package/src/browser/color-registry.ts +3 -85
- package/src/browser/common-frontend-contribution.ts +64 -64
- package/src/browser/core-preferences.ts +24 -21
- package/src/browser/dialogs.ts +4 -4
- package/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +2 -2
- package/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +10 -4
- package/src/browser/keyboard/keys.ts +2 -675
- package/src/browser/messaging/ws-connection-provider.ts +13 -4
- package/src/browser/quick-input/quick-command-frontend-contribution.ts +1 -1
- package/src/browser/quick-input/quick-command-service.ts +2 -2
- package/src/browser/quick-input/quick-input-service.ts +1 -278
- package/src/browser/shell/tab-bar-toolbar.tsx +1 -1
- package/src/browser/storage-service.spec.ts +1 -1
- package/src/browser/theming.ts +6 -17
- package/src/browser/window/default-window-service.ts +1 -1
- package/src/browser/window-contribution.ts +2 -2
- package/src/common/color.ts +100 -0
- package/src/common/command.ts +10 -0
- package/src/common/i18n/localization.ts +13 -3
- package/src/common/i18n/nls.metadata.json +20421 -0
- package/src/common/keys.ts +693 -0
- package/src/common/messaging/abstract-connection-provider.ts +3 -1
- package/src/common/messaging/proxy-factory.ts +1 -1
- package/src/common/nls.ts +74 -0
- package/src/common/path.spec.ts +15 -0
- package/src/common/path.ts +16 -4
- package/src/common/promise-util.ts +3 -3
- package/src/common/quick-pick-service.ts +299 -4
- package/src/common/theme.ts +32 -0
- package/src/electron-browser/menu/electron-menu-contribution.ts +17 -17
- package/src/electron-browser/window/electron-window-preferences.ts +2 -2
|
@@ -17,95 +17,13 @@
|
|
|
17
17
|
import { injectable } from 'inversify';
|
|
18
18
|
import { DisposableCollection, Disposable } from '../common/disposable';
|
|
19
19
|
import { Emitter } from '../common/event';
|
|
20
|
+
import { ColorDefinition, ColorCssVariable } from '../common/color';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
|
-
*
|
|
23
|
+
* @deprecated since 1.20.0. Import from `@theia/core/lib/common/color` instead.
|
|
23
24
|
*/
|
|
24
|
-
export
|
|
25
|
-
export namespace Color {
|
|
26
|
-
export function rgba(r: number, g: number, b: number, a: number = 1): Color {
|
|
27
|
-
return { r, g, b, a };
|
|
28
|
-
}
|
|
29
|
-
export function hsla(h: number, s: number, l: number, a: number = 1): Color {
|
|
30
|
-
return { h, s, l, a };
|
|
31
|
-
}
|
|
32
|
-
export const white = rgba(255, 255, 255, 1);
|
|
33
|
-
export const black = rgba(0, 0, 0, 1);
|
|
34
|
-
export function transparent(v: string, f: number): ColorTransformation {
|
|
35
|
-
return { v, f, kind: 'transparent' };
|
|
36
|
-
}
|
|
37
|
-
export function lighten(v: string, f: number): ColorTransformation {
|
|
38
|
-
return { v, f, kind: 'lighten' };
|
|
39
|
-
}
|
|
40
|
-
export function darken(v: string, f: number): ColorTransformation {
|
|
41
|
-
return { v, f, kind: 'darken' };
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
export interface ColorTransformation {
|
|
45
|
-
kind: 'transparent' | 'lighten' | 'darken'
|
|
46
|
-
v: string
|
|
47
|
-
f: number
|
|
48
|
-
}
|
|
49
|
-
export interface RGBA {
|
|
50
|
-
/**
|
|
51
|
-
* Red: integer in [0-255]
|
|
52
|
-
*/
|
|
53
|
-
readonly r: number;
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* Green: integer in [0-255]
|
|
57
|
-
*/
|
|
58
|
-
readonly g: number;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Blue: integer in [0-255]
|
|
62
|
-
*/
|
|
63
|
-
readonly b: number;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Alpha: float in [0-1]
|
|
67
|
-
*/
|
|
68
|
-
readonly a: number;
|
|
69
|
-
}
|
|
70
|
-
export interface HSLA {
|
|
71
|
-
/**
|
|
72
|
-
* Hue: integer in [0, 360]
|
|
73
|
-
*/
|
|
74
|
-
readonly h: number;
|
|
75
|
-
/**
|
|
76
|
-
* Saturation: float in [0, 1]
|
|
77
|
-
*/
|
|
78
|
-
readonly s: number;
|
|
79
|
-
/**
|
|
80
|
-
* Luminosity: float in [0, 1]
|
|
81
|
-
*/
|
|
82
|
-
readonly l: number;
|
|
83
|
-
/**
|
|
84
|
-
* Alpha: float in [0, 1]
|
|
85
|
-
*/
|
|
86
|
-
readonly a: number;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface ColorDefaults {
|
|
90
|
-
light?: Color
|
|
91
|
-
dark?: Color
|
|
92
|
-
hc?: Color
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface ColorDefinition {
|
|
96
|
-
id: string
|
|
97
|
-
defaults?: ColorDefaults
|
|
98
|
-
description: string
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export interface ColorCssVariable {
|
|
102
|
-
name: string
|
|
103
|
-
value: string
|
|
104
|
-
}
|
|
25
|
+
export * from '../common/color';
|
|
105
26
|
|
|
106
|
-
/**
|
|
107
|
-
* It should be implemented by an extension, e.g. by the monaco extension.
|
|
108
|
-
*/
|
|
109
27
|
@injectable()
|
|
110
28
|
export class ColorRegistry {
|
|
111
29
|
|
|
@@ -90,67 +90,67 @@ export namespace CommonMenus {
|
|
|
90
90
|
|
|
91
91
|
export namespace CommonCommands {
|
|
92
92
|
|
|
93
|
-
export const FILE_CATEGORY_KEY = 'vscode/menubarControl/mFile';
|
|
94
|
-
export const VIEW_CATEGORY_KEY = 'vscode/menubarControl/mView';
|
|
95
|
-
export const PREFERENCES_CATEGORY_KEY = 'vscode/actions/preferences';
|
|
96
93
|
export const FILE_CATEGORY = 'File';
|
|
97
94
|
export const VIEW_CATEGORY = 'View';
|
|
98
95
|
export const PREFERENCES_CATEGORY = 'Preferences';
|
|
96
|
+
export const FILE_CATEGORY_KEY = nls.getDefaultKey(FILE_CATEGORY);
|
|
97
|
+
export const VIEW_CATEGORY_KEY = nls.getDefaultKey(VIEW_CATEGORY);
|
|
98
|
+
export const PREFERENCES_CATEGORY_KEY = nls.getDefaultKey(PREFERENCES_CATEGORY);
|
|
99
99
|
|
|
100
100
|
export const OPEN: Command = {
|
|
101
101
|
id: 'core.open',
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
export const CUT = Command.
|
|
104
|
+
export const CUT = Command.toDefaultLocalizedCommand({
|
|
105
105
|
id: 'core.cut',
|
|
106
106
|
label: 'Cut'
|
|
107
|
-
}
|
|
108
|
-
export const COPY = Command.
|
|
107
|
+
});
|
|
108
|
+
export const COPY = Command.toDefaultLocalizedCommand({
|
|
109
109
|
id: 'core.copy',
|
|
110
110
|
label: 'Copy'
|
|
111
|
-
}
|
|
112
|
-
export const PASTE = Command.
|
|
111
|
+
});
|
|
112
|
+
export const PASTE = Command.toDefaultLocalizedCommand({
|
|
113
113
|
id: 'core.paste',
|
|
114
114
|
label: 'Paste'
|
|
115
|
-
}
|
|
115
|
+
});
|
|
116
116
|
|
|
117
|
-
export const COPY_PATH = Command.
|
|
117
|
+
export const COPY_PATH = Command.toDefaultLocalizedCommand({
|
|
118
118
|
id: 'core.copy.path',
|
|
119
119
|
label: 'Copy Path'
|
|
120
|
-
}
|
|
120
|
+
});
|
|
121
121
|
|
|
122
|
-
export const UNDO = Command.
|
|
122
|
+
export const UNDO = Command.toDefaultLocalizedCommand({
|
|
123
123
|
id: 'core.undo',
|
|
124
124
|
label: 'Undo'
|
|
125
|
-
}
|
|
126
|
-
export const REDO = Command.
|
|
125
|
+
});
|
|
126
|
+
export const REDO = Command.toDefaultLocalizedCommand({
|
|
127
127
|
id: 'core.redo',
|
|
128
128
|
label: 'Redo'
|
|
129
|
-
}
|
|
130
|
-
export const SELECT_ALL = Command.
|
|
129
|
+
});
|
|
130
|
+
export const SELECT_ALL = Command.toDefaultLocalizedCommand({
|
|
131
131
|
id: 'core.selectAll',
|
|
132
132
|
label: 'Select All'
|
|
133
|
-
}
|
|
133
|
+
});
|
|
134
134
|
|
|
135
|
-
export const FIND = Command.
|
|
135
|
+
export const FIND = Command.toDefaultLocalizedCommand({
|
|
136
136
|
id: 'core.find',
|
|
137
137
|
label: 'Find'
|
|
138
|
-
}
|
|
139
|
-
export const REPLACE = Command.
|
|
138
|
+
});
|
|
139
|
+
export const REPLACE = Command.toDefaultLocalizedCommand({
|
|
140
140
|
id: 'core.replace',
|
|
141
141
|
label: 'Replace'
|
|
142
|
-
}
|
|
142
|
+
});
|
|
143
143
|
|
|
144
|
-
export const NEXT_TAB = Command.
|
|
144
|
+
export const NEXT_TAB = Command.toDefaultLocalizedCommand({
|
|
145
145
|
id: 'core.nextTab',
|
|
146
146
|
category: VIEW_CATEGORY,
|
|
147
|
-
label: '
|
|
148
|
-
}
|
|
149
|
-
export const PREVIOUS_TAB = Command.
|
|
147
|
+
label: 'Show Next Tab'
|
|
148
|
+
});
|
|
149
|
+
export const PREVIOUS_TAB = Command.toDefaultLocalizedCommand({
|
|
150
150
|
id: 'core.previousTab',
|
|
151
151
|
category: VIEW_CATEGORY,
|
|
152
|
-
label: '
|
|
153
|
-
}
|
|
152
|
+
label: 'Show Previous Tab'
|
|
153
|
+
});
|
|
154
154
|
export const NEXT_TAB_IN_GROUP = Command.toLocalizedCommand({
|
|
155
155
|
id: 'core.nextTabInGroup',
|
|
156
156
|
category: VIEW_CATEGORY,
|
|
@@ -221,70 +221,70 @@ export namespace CommonCommands {
|
|
|
221
221
|
category: VIEW_CATEGORY,
|
|
222
222
|
label: 'Toggle Bottom Panel'
|
|
223
223
|
}, 'theia/core/common/collapseBottomPanel', VIEW_CATEGORY_KEY);
|
|
224
|
-
export const TOGGLE_STATUS_BAR = Command.
|
|
224
|
+
export const TOGGLE_STATUS_BAR = Command.toDefaultLocalizedCommand({
|
|
225
225
|
id: 'workbench.action.toggleStatusbarVisibility',
|
|
226
226
|
category: VIEW_CATEGORY,
|
|
227
227
|
label: 'Toggle Status Bar Visibility'
|
|
228
|
-
}
|
|
228
|
+
});
|
|
229
229
|
export const TOGGLE_MAXIMIZED = Command.toLocalizedCommand({
|
|
230
230
|
id: 'core.toggleMaximized',
|
|
231
231
|
category: VIEW_CATEGORY,
|
|
232
232
|
label: 'Toggle Maximized'
|
|
233
233
|
}, 'theia/core/common/toggleMaximized', VIEW_CATEGORY_KEY);
|
|
234
|
-
export const OPEN_VIEW = Command.
|
|
234
|
+
export const OPEN_VIEW = Command.toDefaultLocalizedCommand({
|
|
235
235
|
id: 'core.openView',
|
|
236
236
|
category: VIEW_CATEGORY,
|
|
237
237
|
label: 'Open View...'
|
|
238
|
-
}
|
|
238
|
+
});
|
|
239
239
|
|
|
240
|
-
export const SAVE = Command.
|
|
240
|
+
export const SAVE = Command.toDefaultLocalizedCommand({
|
|
241
241
|
id: 'core.save',
|
|
242
242
|
category: FILE_CATEGORY,
|
|
243
243
|
label: 'Save',
|
|
244
|
-
}
|
|
245
|
-
export const SAVE_WITHOUT_FORMATTING = Command.
|
|
244
|
+
});
|
|
245
|
+
export const SAVE_WITHOUT_FORMATTING = Command.toDefaultLocalizedCommand({
|
|
246
246
|
id: 'core.saveWithoutFormatting',
|
|
247
247
|
category: FILE_CATEGORY,
|
|
248
248
|
label: 'Save without Formatting',
|
|
249
|
-
}
|
|
250
|
-
export const SAVE_ALL = Command.
|
|
249
|
+
});
|
|
250
|
+
export const SAVE_ALL = Command.toDefaultLocalizedCommand({
|
|
251
251
|
id: 'core.saveAll',
|
|
252
252
|
category: FILE_CATEGORY,
|
|
253
253
|
label: 'Save All',
|
|
254
|
-
}
|
|
254
|
+
});
|
|
255
255
|
|
|
256
|
-
export const AUTO_SAVE = Command.
|
|
256
|
+
export const AUTO_SAVE = Command.toDefaultLocalizedCommand({
|
|
257
257
|
id: 'textEditor.commands.autosave',
|
|
258
258
|
category: FILE_CATEGORY,
|
|
259
259
|
label: 'Auto Save',
|
|
260
|
-
}
|
|
260
|
+
});
|
|
261
261
|
|
|
262
|
-
export const ABOUT_COMMAND = Command.
|
|
262
|
+
export const ABOUT_COMMAND = Command.toDefaultLocalizedCommand({
|
|
263
263
|
id: 'core.about',
|
|
264
264
|
label: 'About'
|
|
265
|
-
}
|
|
265
|
+
});
|
|
266
266
|
|
|
267
|
-
export const OPEN_PREFERENCES = Command.
|
|
267
|
+
export const OPEN_PREFERENCES = Command.toDefaultLocalizedCommand({
|
|
268
268
|
id: 'preferences:open',
|
|
269
269
|
category: PREFERENCES_CATEGORY,
|
|
270
|
-
label: 'Open
|
|
271
|
-
}
|
|
270
|
+
label: 'Open Settings (UI)',
|
|
271
|
+
});
|
|
272
272
|
|
|
273
|
-
export const SELECT_COLOR_THEME = Command.
|
|
273
|
+
export const SELECT_COLOR_THEME = Command.toDefaultLocalizedCommand({
|
|
274
274
|
id: 'workbench.action.selectTheme',
|
|
275
275
|
label: 'Color Theme',
|
|
276
276
|
category: PREFERENCES_CATEGORY
|
|
277
|
-
}
|
|
278
|
-
export const SELECT_ICON_THEME = Command.
|
|
277
|
+
});
|
|
278
|
+
export const SELECT_ICON_THEME = Command.toDefaultLocalizedCommand({
|
|
279
279
|
id: 'workbench.action.selectIconTheme',
|
|
280
280
|
label: 'File Icon Theme',
|
|
281
281
|
category: PREFERENCES_CATEGORY
|
|
282
|
-
}
|
|
282
|
+
});
|
|
283
283
|
|
|
284
|
-
export const CONFIGURE_DISPLAY_LANGUAGE = Command.
|
|
284
|
+
export const CONFIGURE_DISPLAY_LANGUAGE = Command.toDefaultLocalizedCommand({
|
|
285
285
|
id: 'workbench.action.configureLanguage',
|
|
286
286
|
label: 'Configure Display Language'
|
|
287
|
-
}
|
|
287
|
+
});
|
|
288
288
|
|
|
289
289
|
}
|
|
290
290
|
|
|
@@ -374,14 +374,14 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
374
374
|
app.shell.leftPanelHandler.addBottomMenu({
|
|
375
375
|
id: 'settings-menu',
|
|
376
376
|
iconClass: 'codicon codicon-settings-gear',
|
|
377
|
-
title: nls.
|
|
377
|
+
title: nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY),
|
|
378
378
|
menuPath: SETTINGS_MENU,
|
|
379
379
|
order: 0,
|
|
380
380
|
});
|
|
381
381
|
const accountsMenu = {
|
|
382
382
|
id: 'accounts-menu',
|
|
383
383
|
iconClass: 'codicon codicon-person',
|
|
384
|
-
title: nls.
|
|
384
|
+
title: nls.localizeByDefault('Accounts'),
|
|
385
385
|
menuPath: ACCOUNTS_MENU,
|
|
386
386
|
order: 1,
|
|
387
387
|
};
|
|
@@ -446,7 +446,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
446
446
|
this.shell.leftPanelHandler.addTopMenu({
|
|
447
447
|
id: mainMenuId,
|
|
448
448
|
iconClass: 'codicon codicon-menu',
|
|
449
|
-
title: nls.
|
|
449
|
+
title: nls.localizeByDefault('Application Menu'),
|
|
450
450
|
menuPath: ['menubar'],
|
|
451
451
|
order: 0,
|
|
452
452
|
});
|
|
@@ -479,10 +479,10 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
479
479
|
}
|
|
480
480
|
|
|
481
481
|
registerMenus(registry: MenuModelRegistry): void {
|
|
482
|
-
registry.registerSubmenu(CommonMenus.FILE, nls.
|
|
483
|
-
registry.registerSubmenu(CommonMenus.EDIT, nls.
|
|
484
|
-
registry.registerSubmenu(CommonMenus.VIEW, nls.
|
|
485
|
-
registry.registerSubmenu(CommonMenus.HELP, nls.
|
|
482
|
+
registry.registerSubmenu(CommonMenus.FILE, nls.localizeByDefault('File'));
|
|
483
|
+
registry.registerSubmenu(CommonMenus.EDIT, nls.localizeByDefault('Edit'));
|
|
484
|
+
registry.registerSubmenu(CommonMenus.VIEW, nls.localizeByDefault('View'));
|
|
485
|
+
registry.registerSubmenu(CommonMenus.HELP, nls.localizeByDefault('Help'));
|
|
486
486
|
|
|
487
487
|
registry.registerMenuAction(CommonMenus.FILE_SAVE, {
|
|
488
488
|
commandId: CommonCommands.SAVE.id
|
|
@@ -495,7 +495,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
495
495
|
commandId: CommonCommands.AUTO_SAVE.id
|
|
496
496
|
});
|
|
497
497
|
|
|
498
|
-
registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, nls.
|
|
498
|
+
registry.registerSubmenu(CommonMenus.FILE_SETTINGS_SUBMENU, nls.localizeByDefault(CommonCommands.PREFERENCES_CATEGORY));
|
|
499
499
|
|
|
500
500
|
registry.registerMenuAction(CommonMenus.EDIT_UNDO, {
|
|
501
501
|
commandId: CommonCommands.UNDO.id,
|
|
@@ -548,22 +548,22 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
548
548
|
|
|
549
549
|
registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, {
|
|
550
550
|
commandId: CommonCommands.CLOSE_TAB.id,
|
|
551
|
-
label: nls.
|
|
551
|
+
label: nls.localizeByDefault('Close'),
|
|
552
552
|
order: '0'
|
|
553
553
|
});
|
|
554
554
|
registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, {
|
|
555
555
|
commandId: CommonCommands.CLOSE_OTHER_TABS.id,
|
|
556
|
-
label: nls.
|
|
556
|
+
label: nls.localizeByDefault('Close Others'),
|
|
557
557
|
order: '1'
|
|
558
558
|
});
|
|
559
559
|
registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, {
|
|
560
560
|
commandId: CommonCommands.CLOSE_RIGHT_TABS.id,
|
|
561
|
-
label: nls.
|
|
561
|
+
label: nls.localizeByDefault('Close to the Right'),
|
|
562
562
|
order: '2'
|
|
563
563
|
});
|
|
564
564
|
registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, {
|
|
565
565
|
commandId: CommonCommands.CLOSE_ALL_TABS.id,
|
|
566
|
-
label: nls.
|
|
566
|
+
label: nls.localizeByDefault('Close All'),
|
|
567
567
|
order: '3'
|
|
568
568
|
});
|
|
569
569
|
registry.registerMenuAction(SHELL_TABBAR_CONTEXT_MENU, {
|
|
@@ -1076,7 +1076,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
1076
1076
|
|
|
1077
1077
|
this.quickInputService?.showQuickPick(items,
|
|
1078
1078
|
{
|
|
1079
|
-
placeholder: nls.
|
|
1079
|
+
placeholder: nls.localizeByDefault('Select File Icon Theme'),
|
|
1080
1080
|
activeItem: items.find(item => item.id === resetTo),
|
|
1081
1081
|
onDidChangeSelection: (quickPick: QuickPick<QuickPickItem>, selectedItems: Array<QuickPickItem>) => {
|
|
1082
1082
|
resetTo = undefined;
|
|
@@ -1115,7 +1115,7 @@ export class CommonFrontendContribution implements FrontendApplicationContributi
|
|
|
1115
1115
|
const items = [...itemsByTheme.light, ...itemsByTheme.dark, ...itemsByTheme.hc];
|
|
1116
1116
|
this.quickInputService?.showQuickPick(items,
|
|
1117
1117
|
{
|
|
1118
|
-
placeholder: nls.
|
|
1118
|
+
placeholder: nls.localizeByDefault('Select Color Theme (Up/Down Keys to Preview)'),
|
|
1119
1119
|
activeItem: items.find((item: QuickPickItem) => item.id === resetTo),
|
|
1120
1120
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1121
1121
|
onDidChangeSelection: (quickPick: any, selectedItems: Array<QuickPickItem>) => {
|
|
@@ -32,19 +32,20 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
32
32
|
'always',
|
|
33
33
|
],
|
|
34
34
|
default: 'ifRequired',
|
|
35
|
-
|
|
35
|
+
// eslint-disable-next-line max-len
|
|
36
|
+
description: nls.localizeByDefault('Controls whether to show a confirmation dialog before closing the browser tab or window. Note that even if enabled, browsers may still decide to close a tab or window without confirmation and that this setting is only a hint that may not work in all cases.'),
|
|
36
37
|
},
|
|
37
38
|
'breadcrumbs.enabled': {
|
|
38
39
|
'type': 'boolean',
|
|
39
40
|
'default': true,
|
|
40
|
-
'description': nls.
|
|
41
|
+
'description': nls.localizeByDefault('Enable/disable navigation breadcrumbs.'),
|
|
41
42
|
'scope': 'application'
|
|
42
43
|
},
|
|
43
44
|
'files.encoding': {
|
|
44
45
|
'type': 'string',
|
|
45
46
|
'enum': Object.keys(SUPPORTED_ENCODINGS),
|
|
46
47
|
'default': 'utf8',
|
|
47
|
-
'description': nls.
|
|
48
|
+
'description': nls.localizeByDefault(
|
|
48
49
|
'The default character set encoding to use when reading and writing files. This setting can also be configured per language.'),
|
|
49
50
|
'scope': 'language-overridable',
|
|
50
51
|
'enumDescriptions': Object.keys(SUPPORTED_ENCODINGS).map(key => SUPPORTED_ENCODINGS[key].labelLong),
|
|
@@ -57,22 +58,22 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
57
58
|
'keyCode',
|
|
58
59
|
],
|
|
59
60
|
default: 'code',
|
|
60
|
-
description: nls.
|
|
61
|
-
'
|
|
61
|
+
description: nls.localizeByDefault(
|
|
62
|
+
'Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`.')
|
|
62
63
|
},
|
|
63
64
|
'window.menuBarVisibility': {
|
|
64
65
|
type: 'string',
|
|
65
66
|
enum: ['classic', 'visible', 'hidden', 'compact'],
|
|
66
67
|
markdownEnumDescriptions: [
|
|
67
|
-
nls.
|
|
68
|
-
nls.
|
|
69
|
-
nls.
|
|
70
|
-
nls.
|
|
68
|
+
nls.localizeByDefault('Menu is only hidden in full screen mode.'),
|
|
69
|
+
nls.localizeByDefault('Menu is always visible even in full screen mode.'),
|
|
70
|
+
nls.localizeByDefault('Menu is always hidden.'),
|
|
71
|
+
nls.localizeByDefault('Menu is displayed as a compact button in the sidebar. This value is ignored when `#window.titleBarStyle#` is `native`.')
|
|
71
72
|
],
|
|
72
73
|
default: 'classic',
|
|
73
74
|
scope: 'application',
|
|
74
|
-
|
|
75
|
-
A setting of '
|
|
75
|
+
// eslint-disable-next-line max-len
|
|
76
|
+
markdownDescription: nls.localizeByDefault("Control the visibility of the menu bar. A setting of 'toggle' means that the menu bar is hidden and a single press of the Alt key will show it. By default, the menu bar will be visible, unless the window is full screen."),
|
|
76
77
|
included: !isOSX
|
|
77
78
|
},
|
|
78
79
|
'workbench.list.openMode': {
|
|
@@ -82,17 +83,19 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
82
83
|
'doubleClick'
|
|
83
84
|
],
|
|
84
85
|
default: 'singleClick',
|
|
85
|
-
|
|
86
|
+
// eslint-disable-next-line max-len
|
|
87
|
+
description: nls.localizeByDefault('Controls how to open items in trees and lists using the mouse (if supported). For parents with children in trees, this setting will control if a single click expands the parent or a double click. Note that some trees and lists might choose to ignore this setting if it is not applicable. ')
|
|
86
88
|
},
|
|
87
89
|
'workbench.editor.highlightModifiedTabs': {
|
|
88
90
|
'type': 'boolean',
|
|
89
|
-
|
|
91
|
+
// eslint-disable-next-line max-len
|
|
92
|
+
'description': nls.localizeByDefault('Controls whether a top border is drawn on modified (dirty) editor tabs or not. This value is ignored when `#workbench.editor.showTabs#` is disabled.'),
|
|
90
93
|
'default': false
|
|
91
94
|
},
|
|
92
95
|
'workbench.editor.closeOnFileDelete': {
|
|
93
96
|
'type': 'boolean',
|
|
94
97
|
// eslint-disable-next-line max-len
|
|
95
|
-
'description': nls.
|
|
98
|
+
'description': nls.localizeByDefault('Controls whether editors showing a file that was opened during the session should close automatically when getting deleted or renamed by some other process. Disabling this will keep the editor open on such an event. Note that deleting from within the application will always close the editor and that dirty files will never close to preserve your data.'),
|
|
96
99
|
'default': false
|
|
97
100
|
},
|
|
98
101
|
'workbench.commandPalette.history': {
|
|
@@ -100,38 +103,38 @@ export const corePreferenceSchema: PreferenceSchema = {
|
|
|
100
103
|
default: 50,
|
|
101
104
|
minimum: 0,
|
|
102
105
|
// eslint-disable-next-line max-len
|
|
103
|
-
description: nls.
|
|
106
|
+
description: nls.localizeByDefault('Controls the number of recently used commands to keep in history for the command palette. Set to 0 to disable command history.')
|
|
104
107
|
},
|
|
105
108
|
'workbench.colorTheme': {
|
|
106
109
|
type: 'string',
|
|
107
110
|
default: FrontendApplicationConfigProvider.get().defaultTheme,
|
|
108
|
-
description: nls.
|
|
111
|
+
description: nls.localizeByDefault('Specifies the color theme used in the workbench.')
|
|
109
112
|
},
|
|
110
113
|
'workbench.iconTheme': {
|
|
111
114
|
type: ['string', 'null'],
|
|
112
115
|
default: FrontendApplicationConfigProvider.get().defaultIconTheme,
|
|
113
|
-
description: nls.
|
|
116
|
+
description: nls.localizeByDefault("Specifies the file icon theme used in the workbench or 'null' to not show any file icons.")
|
|
114
117
|
},
|
|
115
118
|
'workbench.silentNotifications': {
|
|
116
119
|
type: 'boolean',
|
|
117
120
|
default: false,
|
|
118
|
-
description: nls.localize('
|
|
121
|
+
description: nls.localize('theia/core/silentNotifications', 'Controls whether to suppress notification popups.')
|
|
119
122
|
},
|
|
120
123
|
'workbench.statusBar.visible': {
|
|
121
124
|
type: 'boolean',
|
|
122
125
|
default: true,
|
|
123
|
-
description: 'Controls the visibility of the status bar at the bottom of the workbench.'
|
|
126
|
+
description: nls.localizeByDefault('Controls the visibility of the status bar at the bottom of the workbench.')
|
|
124
127
|
},
|
|
125
128
|
'workbench.tree.renderIndentGuides': {
|
|
126
129
|
type: 'string',
|
|
127
130
|
enum: ['onHover', 'none', 'always'],
|
|
128
131
|
default: 'onHover',
|
|
129
|
-
description: nls.
|
|
132
|
+
description: nls.localizeByDefault('Controls whether the tree should render indent guides.')
|
|
130
133
|
},
|
|
131
134
|
'workbench.hover.delay': {
|
|
132
135
|
type: 'number',
|
|
133
136
|
default: isOSX ? 1500 : 500,
|
|
134
|
-
description: 'Controls the delay in milliseconds after which the hover is shown
|
|
137
|
+
description: nls.localizeByDefault('Controls the delay in milliseconds after which the hover is shown.')
|
|
135
138
|
},
|
|
136
139
|
}
|
|
137
140
|
};
|
package/src/browser/dialogs.ts
CHANGED
|
@@ -67,10 +67,10 @@ export namespace DialogError {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
export namespace Dialog {
|
|
70
|
-
export const YES = nls.
|
|
71
|
-
export const NO = nls.
|
|
72
|
-
export const OK = nls.
|
|
73
|
-
export const CANCEL = nls.
|
|
70
|
+
export const YES = nls.localizeByDefault('Yes');
|
|
71
|
+
export const NO = nls.localizeByDefault('No');
|
|
72
|
+
export const OK = nls.localizeByDefault('OK');
|
|
73
|
+
export const CANCEL = nls.localizeByDefault('Cancel');
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
@injectable()
|
|
@@ -23,8 +23,8 @@ import { nls } from '../../common/nls';
|
|
|
23
23
|
|
|
24
24
|
export namespace KeyboardCommands {
|
|
25
25
|
|
|
26
|
-
const KEYBOARD_CATEGORY_KEY = 'vscode/settingsLayout/keyboard';
|
|
27
26
|
const KEYBOARD_CATEGORY = 'Keyboard';
|
|
27
|
+
const KEYBOARD_CATEGORY_KEY = nls.getDefaultKey(KEYBOARD_CATEGORY);
|
|
28
28
|
|
|
29
29
|
export const CHOOSE_KEYBOARD_LAYOUT = Command.toLocalizedCommand({
|
|
30
30
|
id: 'core.keyboard.choose',
|
|
@@ -52,7 +52,7 @@ export class BrowserKeyboardFrontendContribution implements CommandContribution
|
|
|
52
52
|
protected async chooseLayout(): Promise<KeyboardLayoutData | undefined> {
|
|
53
53
|
const current = this.layoutProvider.currentLayoutData;
|
|
54
54
|
const autodetect: QuickPickValue<'autodetect'> = {
|
|
55
|
-
label: nls.
|
|
55
|
+
label: nls.localizeByDefault('Auto-detect'),
|
|
56
56
|
description: this.layoutProvider.currentLayoutSource !== 'user-choice' ? nls.localize('theia/core/keyboard/current', '(current: {0})', current.name) : undefined,
|
|
57
57
|
detail: nls.localize('theia/core/keyboard/tryDetect', 'Try to detect the keyboard layout from browser information and pressed keys.'),
|
|
58
58
|
value: 'autodetect'
|
|
@@ -14,6 +14,10 @@
|
|
|
14
14
|
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
|
|
15
15
|
********************************************************************************/
|
|
16
16
|
|
|
17
|
+
import { enableJSDOM } from '../test/jsdom';
|
|
18
|
+
|
|
19
|
+
let disableJSDOM = enableJSDOM();
|
|
20
|
+
|
|
17
21
|
import { Container, injectable } from 'inversify';
|
|
18
22
|
import type { IMacKeyboardLayoutInfo } from 'native-keymap';
|
|
19
23
|
import * as chai from 'chai';
|
|
@@ -26,11 +30,15 @@ import { WindowService } from '../window/window-service';
|
|
|
26
30
|
import { BrowserKeyboardLayoutProvider } from './browser-keyboard-layout-provider';
|
|
27
31
|
import { Key } from './keys';
|
|
28
32
|
|
|
33
|
+
disableJSDOM();
|
|
34
|
+
|
|
29
35
|
describe('browser keyboard layout provider', function (): void {
|
|
30
36
|
|
|
31
37
|
let stubOSX: sinon.SinonStub;
|
|
32
38
|
let stubWindows: sinon.SinonStub;
|
|
33
|
-
|
|
39
|
+
|
|
40
|
+
before(() => disableJSDOM = enableJSDOM());
|
|
41
|
+
after(() => disableJSDOM());
|
|
34
42
|
|
|
35
43
|
const setup = (system: 'mac' | 'win' | 'linux') => {
|
|
36
44
|
switch (system) {
|
|
@@ -47,7 +55,6 @@ describe('browser keyboard layout provider', function (): void {
|
|
|
47
55
|
stubWindows = sinon.stub(os, 'isWindows').value(false);
|
|
48
56
|
}
|
|
49
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
|
-
stubNavigator = sinon.stub(global, 'navigator' as any).value({});
|
|
51
58
|
const container = new Container();
|
|
52
59
|
container.bind(BrowserKeyboardLayoutProvider).toSelf();
|
|
53
60
|
container.bind(ILogger).to(MockLogger);
|
|
@@ -61,7 +68,6 @@ describe('browser keyboard layout provider', function (): void {
|
|
|
61
68
|
afterEach(() => {
|
|
62
69
|
stubOSX.restore();
|
|
63
70
|
stubWindows.restore();
|
|
64
|
-
stubNavigator.restore();
|
|
65
71
|
});
|
|
66
72
|
|
|
67
73
|
it('detects German Mac layout', async () => {
|
|
@@ -83,7 +89,7 @@ describe('browser keyboard layout provider', function (): void {
|
|
|
83
89
|
currentLayout = l;
|
|
84
90
|
});
|
|
85
91
|
|
|
86
|
-
chai.expect((currentLayout.info as IMacKeyboardLayoutInfo).id).to.equal('com.apple.keylayout.
|
|
92
|
+
chai.expect((currentLayout.info as IMacKeyboardLayoutInfo).id).to.equal('com.apple.keylayout.German');
|
|
87
93
|
service.validateKey({ code: Key.SEMICOLON.code, character: 'm' });
|
|
88
94
|
chai.expect((currentLayout.info as IMacKeyboardLayoutInfo).id).to.equal('com.apple.keylayout.French');
|
|
89
95
|
});
|