@codingame/monaco-vscode-keybindings-service-override 23.3.0 → 24.1.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/index.js +1 -1
- package/package.json +3 -8
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +3 -3
- package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +1 -1
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +6 -6
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +156 -144
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +26 -26
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.d.ts +1 -1
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +3 -3
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.d.ts +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.js +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.d.ts +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.js +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.d.ts +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +2 -2
- package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.d.ts +1 -1
|
@@ -10,7 +10,7 @@ import { DeferredPromise, RunOnceScheduler } from '@codingame/monaco-vscode-api/
|
|
|
10
10
|
import { Event, Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
11
11
|
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
12
12
|
import { UserSettingsLabelProvider } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keybindingLabels';
|
|
13
|
-
import { KeybindingParser } from '@codingame/monaco-vscode-
|
|
13
|
+
import { KeybindingParser } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keybindingParser';
|
|
14
14
|
import { KeyCodeChord, ScanCodeChord } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keybindings';
|
|
15
15
|
import { ScanCode, KeyCode, KeyCodeUtils, ScanCodeUtils, KeyMod, IMMUTABLE_CODE_TO_KEY_CODE } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
16
16
|
import { DisposableStore, toDisposable, Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
@@ -45,44 +45,44 @@ import { ExtensionsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workb
|
|
|
45
45
|
import { IHostService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/host/browser/host.service';
|
|
46
46
|
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
47
47
|
import { OutputBuilder, KeybindingIO } from '../common/keybindingIO.js';
|
|
48
|
-
import { getAllUnboundCommands } from '@codingame/monaco-vscode-
|
|
48
|
+
import { getAllUnboundCommands } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/keybinding/browser/unboundCommands';
|
|
49
49
|
|
|
50
50
|
var WorkbenchKeybindingService_1;
|
|
51
51
|
function isValidContributedKeyBinding(keyBinding, rejects) {
|
|
52
52
|
if (!keyBinding) {
|
|
53
|
-
rejects.push(( localize(
|
|
53
|
+
rejects.push(( localize(14060, "expected non-empty value.")));
|
|
54
54
|
return false;
|
|
55
55
|
}
|
|
56
56
|
if (typeof keyBinding.command !== 'string') {
|
|
57
57
|
rejects.push(( localize(
|
|
58
|
-
|
|
58
|
+
14061,
|
|
59
59
|
"property `{0}` is mandatory and must be of type `string`",
|
|
60
60
|
'command'
|
|
61
61
|
)));
|
|
62
62
|
return false;
|
|
63
63
|
}
|
|
64
64
|
if (keyBinding.key && typeof keyBinding.key !== 'string') {
|
|
65
|
-
rejects.push(( localize(
|
|
65
|
+
rejects.push(( localize(14062, "property `{0}` can be omitted or must be of type `string`", 'key')));
|
|
66
66
|
return false;
|
|
67
67
|
}
|
|
68
68
|
if (keyBinding.when && typeof keyBinding.when !== 'string') {
|
|
69
|
-
rejects.push(( localize(
|
|
69
|
+
rejects.push(( localize(14062, "property `{0}` can be omitted or must be of type `string`", 'when')));
|
|
70
70
|
return false;
|
|
71
71
|
}
|
|
72
72
|
if (keyBinding.mac && typeof keyBinding.mac !== 'string') {
|
|
73
|
-
rejects.push(( localize(
|
|
73
|
+
rejects.push(( localize(14062, "property `{0}` can be omitted or must be of type `string`", 'mac')));
|
|
74
74
|
return false;
|
|
75
75
|
}
|
|
76
76
|
if (keyBinding.linux && typeof keyBinding.linux !== 'string') {
|
|
77
77
|
rejects.push(( localize(
|
|
78
|
-
|
|
78
|
+
14062,
|
|
79
79
|
"property `{0}` can be omitted or must be of type `string`",
|
|
80
80
|
'linux'
|
|
81
81
|
)));
|
|
82
82
|
return false;
|
|
83
83
|
}
|
|
84
84
|
if (keyBinding.win && typeof keyBinding.win !== 'string') {
|
|
85
|
-
rejects.push(( localize(
|
|
85
|
+
rejects.push(( localize(14062, "property `{0}` can be omitted or must be of type `string`", 'win')));
|
|
86
86
|
return false;
|
|
87
87
|
}
|
|
88
88
|
return true;
|
|
@@ -93,33 +93,33 @@ const keybindingType = {
|
|
|
93
93
|
required: ['command', 'key'],
|
|
94
94
|
properties: {
|
|
95
95
|
command: {
|
|
96
|
-
description: ( localize(
|
|
96
|
+
description: ( localize(14063, 'Identifier of the command to run when keybinding is triggered.')),
|
|
97
97
|
type: 'string'
|
|
98
98
|
},
|
|
99
99
|
args: {
|
|
100
|
-
description: ( localize(
|
|
100
|
+
description: ( localize(14064, "Arguments to pass to the command to execute."))
|
|
101
101
|
},
|
|
102
102
|
key: {
|
|
103
103
|
description: ( localize(
|
|
104
|
-
|
|
104
|
+
14065,
|
|
105
105
|
'Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord).'
|
|
106
106
|
)),
|
|
107
107
|
type: 'string'
|
|
108
108
|
},
|
|
109
109
|
mac: {
|
|
110
|
-
description: ( localize(
|
|
110
|
+
description: ( localize(14066, 'Mac specific key or key sequence.')),
|
|
111
111
|
type: 'string'
|
|
112
112
|
},
|
|
113
113
|
linux: {
|
|
114
|
-
description: ( localize(
|
|
114
|
+
description: ( localize(14067, 'Linux specific key or key sequence.')),
|
|
115
115
|
type: 'string'
|
|
116
116
|
},
|
|
117
117
|
win: {
|
|
118
|
-
description: ( localize(
|
|
118
|
+
description: ( localize(14068, 'Windows specific key or key sequence.')),
|
|
119
119
|
type: 'string'
|
|
120
120
|
},
|
|
121
121
|
when: {
|
|
122
|
-
description: ( localize(
|
|
122
|
+
description: ( localize(14069, 'Condition when the key is active.')),
|
|
123
123
|
type: 'string'
|
|
124
124
|
},
|
|
125
125
|
}
|
|
@@ -128,7 +128,7 @@ const keybindingsExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
128
128
|
extensionPoint: 'keybindings',
|
|
129
129
|
deps: [commandsExtensionPoint],
|
|
130
130
|
jsonSchema: {
|
|
131
|
-
description: ( localize(
|
|
131
|
+
description: ( localize(14070, "Contributes keybindings.")),
|
|
132
132
|
oneOf: [
|
|
133
133
|
keybindingType,
|
|
134
134
|
{
|
|
@@ -519,7 +519,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
519
519
|
}
|
|
520
520
|
if (rejects.length > 0) {
|
|
521
521
|
collector.error(( localize(
|
|
522
|
-
|
|
522
|
+
14071,
|
|
523
523
|
"Invalid `contributes.{0}`: {1}",
|
|
524
524
|
keybindingsExtPoint.name,
|
|
525
525
|
rejects.join('\n')
|
|
@@ -607,7 +607,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
607
607
|
static _getAllCommandsAsComment(boundCommands) {
|
|
608
608
|
const unboundCommands = getAllUnboundCommands(boundCommands);
|
|
609
609
|
const pretty = unboundCommands.sort().join('\n// - ');
|
|
610
|
-
return '// ' + ( localize(
|
|
610
|
+
return '// ' + ( localize(14072, "Here are other available commands: ")) + '\n// - ' + pretty;
|
|
611
611
|
}
|
|
612
612
|
mightProducePrintableCharacter(event) {
|
|
613
613
|
if (event.ctrlKey || event.metaKey || event.altKey) {
|
|
@@ -732,7 +732,7 @@ class KeybindingsJsonSchema {
|
|
|
732
732
|
this.schema = {
|
|
733
733
|
id: KeybindingsJsonSchema.schemaId,
|
|
734
734
|
type: 'array',
|
|
735
|
-
title: ( localize(
|
|
735
|
+
title: ( localize(14073, "Keybindings configuration")),
|
|
736
736
|
allowTrailingCommas: true,
|
|
737
737
|
allowComments: true,
|
|
738
738
|
definitions: {
|
|
@@ -756,7 +756,7 @@ class KeybindingsJsonSchema {
|
|
|
756
756
|
'type': 'string',
|
|
757
757
|
'enum': this.commandsEnum,
|
|
758
758
|
'enumDescriptions': this.commandsEnumDescriptions,
|
|
759
|
-
'description': ( localize(
|
|
759
|
+
'description': ( localize(14074, "Name of the command to execute")),
|
|
760
760
|
},
|
|
761
761
|
'commandType': {
|
|
762
762
|
'anyOf': [
|
|
@@ -767,7 +767,7 @@ class KeybindingsJsonSchema {
|
|
|
767
767
|
'type': 'string',
|
|
768
768
|
'enum': this.removalCommandsEnum,
|
|
769
769
|
'enumDescriptions': this.commandsEnumDescriptions,
|
|
770
|
-
'description': ( localize(
|
|
770
|
+
'description': ( localize(14075, "Name of the command to remove keyboard shortcut for")),
|
|
771
771
|
},
|
|
772
772
|
{
|
|
773
773
|
'type': 'string'
|
|
@@ -785,7 +785,7 @@ class KeybindingsJsonSchema {
|
|
|
785
785
|
'properties': {
|
|
786
786
|
'key': {
|
|
787
787
|
'type': 'string',
|
|
788
|
-
'description': ( localize(
|
|
788
|
+
'description': ( localize(14076, "Key or key sequence (separated by space)")),
|
|
789
789
|
},
|
|
790
790
|
'command': {
|
|
791
791
|
'anyOf': [
|
|
@@ -798,7 +798,7 @@ class KeybindingsJsonSchema {
|
|
|
798
798
|
'type': 'array'
|
|
799
799
|
},
|
|
800
800
|
'errorMessage': ( localize(
|
|
801
|
-
|
|
801
|
+
14077,
|
|
802
802
|
"Incorrect type. Expected \"{0}\". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.",
|
|
803
803
|
'string'
|
|
804
804
|
))
|
|
@@ -814,10 +814,10 @@ class KeybindingsJsonSchema {
|
|
|
814
814
|
},
|
|
815
815
|
'when': {
|
|
816
816
|
'type': 'string',
|
|
817
|
-
'description': ( localize(
|
|
817
|
+
'description': ( localize(14078, "Condition when the key is active."))
|
|
818
818
|
},
|
|
819
819
|
'args': {
|
|
820
|
-
'description': ( localize(
|
|
820
|
+
'description': ( localize(14079, "Arguments to pass to the command to execute."))
|
|
821
821
|
}
|
|
822
822
|
},
|
|
823
823
|
'$ref': '#/definitions/commandsSchemas'
|
|
@@ -9,7 +9,7 @@ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
9
9
|
import { INotificationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service";
|
|
10
10
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
11
11
|
import { IStorageService } from "@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service";
|
|
12
|
-
import { IKeyboardLayoutInfo, IKeyboardMapping } from "@codingame/monaco-vscode-
|
|
12
|
+
import { IKeyboardLayoutInfo, IKeyboardMapping } from "@codingame/monaco-vscode-api/vscode/vs/platform/keyboardLayout/common/keyboardLayout";
|
|
13
13
|
import { IKeyboardLayoutService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keyboardLayout/common/keyboardLayout.service";
|
|
14
14
|
export declare class BrowserKeyboardMapperFactoryBase extends Disposable {
|
|
15
15
|
private readonly _configurationService;
|
|
@@ -22,7 +22,7 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
22
22
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
23
23
|
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
24
24
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
25
|
-
import { getKeyboardLayoutId } from '@codingame/monaco-vscode-
|
|
25
|
+
import { getKeyboardLayoutId } from '@codingame/monaco-vscode-api/vscode/vs/platform/keyboardLayout/common/keyboardLayout';
|
|
26
26
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
27
27
|
|
|
28
28
|
function __variableDynamicImportRuntime0__(path) {
|
|
@@ -483,12 +483,12 @@ const keyboardConfiguration = {
|
|
|
483
483
|
'id': 'keyboard',
|
|
484
484
|
'order': 15,
|
|
485
485
|
'type': 'object',
|
|
486
|
-
'title': ( localize(
|
|
486
|
+
'title': ( localize(14080, "Keyboard")),
|
|
487
487
|
'properties': {
|
|
488
488
|
'keyboard.layout': {
|
|
489
489
|
'type': 'string',
|
|
490
490
|
'default': 'autodetect',
|
|
491
|
-
'description': ( localize(
|
|
491
|
+
'description': ( localize(14081, "Control the keyboard layout used in web."))
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
};
|
|
@@ -4,7 +4,7 @@ import { ResolvedKeybindingItem } from "@codingame/monaco-vscode-api/vscode/vs/p
|
|
|
4
4
|
export interface IUserKeybindingItem {
|
|
5
5
|
keybinding: Keybinding | null;
|
|
6
6
|
command: string | null;
|
|
7
|
-
commandArgs?:
|
|
7
|
+
commandArgs?: unknown;
|
|
8
8
|
when: ContextKeyExpression | undefined;
|
|
9
9
|
_sourceKey: string | undefined; /** captures `key` field from `keybindings.json`; `this.keybinding !== null` implies `_sourceKey !== null` */
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
import { KeybindingParser } from '@codingame/monaco-vscode-
|
|
2
|
+
import { KeybindingParser } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keybindingParser';
|
|
3
3
|
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
4
4
|
|
|
5
5
|
class KeybindingIO {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IKeyboardLayoutInfo } from "@codingame/monaco-vscode-
|
|
1
|
+
import { IKeyboardLayoutInfo } from "@codingame/monaco-vscode-api/vscode/vs/platform/keyboardLayout/common/keyboardLayout";
|
|
2
2
|
export interface IRawMixedKeyboardMapping {
|
|
3
3
|
[key: string]: {
|
|
4
4
|
value: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { isWindows, isLinux } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
3
|
-
import { getKeyboardLayoutId } from '@codingame/monaco-vscode-
|
|
3
|
+
import { getKeyboardLayoutId } from '@codingame/monaco-vscode-api/vscode/vs/platform/keyboardLayout/common/keyboardLayout';
|
|
4
4
|
|
|
5
5
|
function deserializeMapping(serializedMapping) {
|
|
6
6
|
const mapping = serializedMapping;
|
|
@@ -3,7 +3,7 @@ import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/com
|
|
|
3
3
|
import { IKeyboardEvent } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding";
|
|
4
4
|
import { IKeyboardMapper } from "../../../../platform/keyboardLayout/common/keyboardMapper.js";
|
|
5
5
|
import { BaseResolvedKeybinding } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/baseResolvedKeybinding";
|
|
6
|
-
import { IMacLinuxKeyboardMapping } from "@codingame/monaco-vscode-
|
|
6
|
+
import { IMacLinuxKeyboardMapping } from "@codingame/monaco-vscode-api/vscode/vs/platform/keyboardLayout/common/keyboardLayout";
|
|
7
7
|
export declare class NativeResolvedKeybinding extends BaseResolvedKeybinding<ScanCodeChord> {
|
|
8
8
|
private readonly _mapper;
|
|
9
9
|
constructor(mapper: MacLinuxKeyboardMapper, os: OperatingSystem, chords: ScanCodeChord[]);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { CharCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/charCode';
|
|
3
|
-
import { IMMUTABLE_CODE_TO_KEY_CODE, KeyCode, ScanCode, ScanCodeUtils, KeyCodeUtils, IMMUTABLE_KEY_CODE_TO_CODE } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
3
|
+
import { IMMUTABLE_CODE_TO_KEY_CODE, KeyCode, ScanCode, ScanCodeUtils, KeyCodeUtils, isModifierKey, IMMUTABLE_KEY_CODE_TO_CODE } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
4
4
|
import { ScanCodeChord, KeyCodeChord } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keybindings';
|
|
5
5
|
import { OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
6
6
|
import { BaseResolvedKeybinding } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/baseResolvedKeybinding';
|
|
@@ -294,7 +294,7 @@ class MacLinuxKeyboardMapper {
|
|
|
294
294
|
if (keyCode !== KeyCode.DependsOnKbLayout) {
|
|
295
295
|
_registerAllCombos(0, 0, 0, scanCode, keyCode);
|
|
296
296
|
this._scanCodeToLabel[scanCode] = ( KeyCodeUtils.toString(keyCode));
|
|
297
|
-
if (keyCode === KeyCode.Unknown || keyCode
|
|
297
|
+
if (keyCode === KeyCode.Unknown || isModifierKey(keyCode)) {
|
|
298
298
|
this._scanCodeToDispatch[scanCode] = null;
|
|
299
299
|
}
|
|
300
300
|
else {
|
|
@@ -3,7 +3,7 @@ import { ResolvedKeybinding, KeyCodeChord, SingleModifierChord, ScanCodeChord, K
|
|
|
3
3
|
import { IKeyboardEvent } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding";
|
|
4
4
|
import { IKeyboardMapper } from "../../../../platform/keyboardLayout/common/keyboardMapper.js";
|
|
5
5
|
import { BaseResolvedKeybinding } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/baseResolvedKeybinding";
|
|
6
|
-
import { IWindowsKeyboardMapping } from "@codingame/monaco-vscode-
|
|
6
|
+
import { IWindowsKeyboardMapping } from "@codingame/monaco-vscode-api/vscode/vs/platform/keyboardLayout/common/keyboardLayout";
|
|
7
7
|
export interface IScanCodeMapping {
|
|
8
8
|
scanCode: ScanCode;
|
|
9
9
|
keyCode: KeyCode;
|