@codingame/monaco-vscode-keybindings-service-override 37.2.0 → 37.3.1
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 -3
- 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 +3 -3
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +161 -159
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +27 -27
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +5 -5
- package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +1 -1
- package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +1 -1
|
@@ -51,39 +51,39 @@ import { EditorContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/editor
|
|
|
51
51
|
var WorkbenchKeybindingService_1;
|
|
52
52
|
function isValidContributedKeyBinding(keyBinding, rejects) {
|
|
53
53
|
if (!keyBinding) {
|
|
54
|
-
rejects.push(( localize(
|
|
54
|
+
rejects.push(( localize(21985, "expected non-empty value.")));
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
57
57
|
if (typeof keyBinding.command !== "string") {
|
|
58
58
|
rejects.push(( localize(
|
|
59
|
-
|
|
59
|
+
21986,
|
|
60
60
|
"property `{0}` is mandatory and must be of type `string`",
|
|
61
61
|
"command"
|
|
62
62
|
)));
|
|
63
63
|
return false;
|
|
64
64
|
}
|
|
65
65
|
if (keyBinding.key && typeof keyBinding.key !== "string") {
|
|
66
|
-
rejects.push(( localize(
|
|
66
|
+
rejects.push(( localize(21987, "property `{0}` can be omitted or must be of type `string`", "key")));
|
|
67
67
|
return false;
|
|
68
68
|
}
|
|
69
69
|
if (keyBinding.when && typeof keyBinding.when !== "string") {
|
|
70
|
-
rejects.push(( localize(
|
|
70
|
+
rejects.push(( localize(21987, "property `{0}` can be omitted or must be of type `string`", "when")));
|
|
71
71
|
return false;
|
|
72
72
|
}
|
|
73
73
|
if (keyBinding.mac && typeof keyBinding.mac !== "string") {
|
|
74
|
-
rejects.push(( localize(
|
|
74
|
+
rejects.push(( localize(21987, "property `{0}` can be omitted or must be of type `string`", "mac")));
|
|
75
75
|
return false;
|
|
76
76
|
}
|
|
77
77
|
if (keyBinding.linux && typeof keyBinding.linux !== "string") {
|
|
78
78
|
rejects.push(( localize(
|
|
79
|
-
|
|
79
|
+
21987,
|
|
80
80
|
"property `{0}` can be omitted or must be of type `string`",
|
|
81
81
|
"linux"
|
|
82
82
|
)));
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
85
|
if (keyBinding.win && typeof keyBinding.win !== "string") {
|
|
86
|
-
rejects.push(( localize(
|
|
86
|
+
rejects.push(( localize(21987, "property `{0}` can be omitted or must be of type `string`", "win")));
|
|
87
87
|
return false;
|
|
88
88
|
}
|
|
89
89
|
return true;
|
|
@@ -97,33 +97,33 @@ const keybindingType = {
|
|
|
97
97
|
required: ["command", "key"],
|
|
98
98
|
properties: {
|
|
99
99
|
command: {
|
|
100
|
-
description: ( localize(
|
|
100
|
+
description: ( localize(21988, "Identifier of the command to run when keybinding is triggered.")),
|
|
101
101
|
type: "string"
|
|
102
102
|
},
|
|
103
103
|
args: {
|
|
104
|
-
description: ( localize(
|
|
104
|
+
description: ( localize(21989, "Arguments to pass to the command to execute."))
|
|
105
105
|
},
|
|
106
106
|
key: {
|
|
107
107
|
description: ( localize(
|
|
108
|
-
|
|
108
|
+
21990,
|
|
109
109
|
"Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord)."
|
|
110
110
|
)),
|
|
111
111
|
type: "string"
|
|
112
112
|
},
|
|
113
113
|
mac: {
|
|
114
|
-
description: ( localize(
|
|
114
|
+
description: ( localize(21991, "Mac specific key or key sequence.")),
|
|
115
115
|
type: "string"
|
|
116
116
|
},
|
|
117
117
|
linux: {
|
|
118
|
-
description: ( localize(
|
|
118
|
+
description: ( localize(21992, "Linux specific key or key sequence.")),
|
|
119
119
|
type: "string"
|
|
120
120
|
},
|
|
121
121
|
win: {
|
|
122
|
-
description: ( localize(
|
|
122
|
+
description: ( localize(21993, "Windows specific key or key sequence.")),
|
|
123
123
|
type: "string"
|
|
124
124
|
},
|
|
125
125
|
when: {
|
|
126
|
-
description: ( localize(
|
|
126
|
+
description: ( localize(21994, "Condition when the key is active.")),
|
|
127
127
|
type: "string"
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -132,7 +132,7 @@ const keybindingsExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
132
132
|
extensionPoint: "keybindings",
|
|
133
133
|
deps: [commandsExtensionPoint],
|
|
134
134
|
jsonSchema: {
|
|
135
|
-
description: ( localize(
|
|
135
|
+
description: ( localize(21995, "Contributes keybindings.")),
|
|
136
136
|
oneOf: [keybindingType, {
|
|
137
137
|
type: "array",
|
|
138
138
|
items: keybindingType
|
|
@@ -317,7 +317,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
317
317
|
}) || "[null]";
|
|
318
318
|
}
|
|
319
319
|
_printResolvedKeybinding(resolvedKeybinding) {
|
|
320
|
-
return
|
|
320
|
+
return resolvedKeybinding.getDispatchChords().map(x => x || "[null]").join(" ");
|
|
321
321
|
}
|
|
322
322
|
_printResolvedKeybindings(output, input, resolvedKeybindings) {
|
|
323
323
|
const padLength = 35;
|
|
@@ -565,7 +565,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
565
565
|
}
|
|
566
566
|
if (rejects.length > 0) {
|
|
567
567
|
collector.error(( localize(
|
|
568
|
-
|
|
568
|
+
21996,
|
|
569
569
|
"Invalid `contributes.{0}`: {1}",
|
|
570
570
|
keybindingsExtPoint.name,
|
|
571
571
|
rejects.join("\n")
|
|
@@ -653,7 +653,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
653
653
|
static _getAllCommandsAsComment(boundCommands) {
|
|
654
654
|
const unboundCommands = getAllUnboundCommands(boundCommands);
|
|
655
655
|
const pretty = unboundCommands.sort().join("\n// - ");
|
|
656
|
-
return "// " + ( localize(
|
|
656
|
+
return "// " + ( localize(21997, "Here are other available commands: ")) + "\n// - " + pretty;
|
|
657
657
|
}
|
|
658
658
|
mightProducePrintableCharacter(event) {
|
|
659
659
|
if (event.ctrlKey || event.metaKey || event.altKey) {
|
|
@@ -749,7 +749,7 @@ class UserKeybindings extends Disposable {
|
|
|
749
749
|
return false;
|
|
750
750
|
}
|
|
751
751
|
this._rawKeybindings = newKeybindings;
|
|
752
|
-
this._keybindings =
|
|
752
|
+
this._keybindings = this._rawKeybindings.map(k => KeybindingIO.readUserKeybindingItem(k));
|
|
753
753
|
return true;
|
|
754
754
|
}
|
|
755
755
|
async readUserKeybindings() {
|
|
@@ -776,7 +776,7 @@ class KeybindingsJsonSchema {
|
|
|
776
776
|
this.schema = {
|
|
777
777
|
id: KeybindingsJsonSchema.schemaId,
|
|
778
778
|
type: "array",
|
|
779
|
-
title: ( localize(
|
|
779
|
+
title: ( localize(21998, "Keybindings configuration")),
|
|
780
780
|
allowTrailingCommas: true,
|
|
781
781
|
allowComments: true,
|
|
782
782
|
definitions: {
|
|
@@ -800,7 +800,7 @@ class KeybindingsJsonSchema {
|
|
|
800
800
|
"type": "string",
|
|
801
801
|
"enum": this.commandsEnum,
|
|
802
802
|
"enumDescriptions": this.commandsEnumDescriptions,
|
|
803
|
-
"description": ( localize(
|
|
803
|
+
"description": ( localize(21999, "Name of the command to execute"))
|
|
804
804
|
},
|
|
805
805
|
"commandType": {
|
|
806
806
|
"anyOf": [{
|
|
@@ -809,7 +809,7 @@ class KeybindingsJsonSchema {
|
|
|
809
809
|
"type": "string",
|
|
810
810
|
"enum": this.removalCommandsEnum,
|
|
811
811
|
"enumDescriptions": this.commandsEnumDescriptions,
|
|
812
|
-
"description": ( localize(
|
|
812
|
+
"description": ( localize(22000, "Name of the command to remove keyboard shortcut for"))
|
|
813
813
|
}, {
|
|
814
814
|
"type": "string"
|
|
815
815
|
}]
|
|
@@ -831,7 +831,7 @@ class KeybindingsJsonSchema {
|
|
|
831
831
|
"properties": {
|
|
832
832
|
"key": {
|
|
833
833
|
"type": "string",
|
|
834
|
-
"description": ( localize(
|
|
834
|
+
"description": ( localize(22001, "Key or key sequence (separated by space)"))
|
|
835
835
|
},
|
|
836
836
|
"command": {
|
|
837
837
|
"anyOf": [{
|
|
@@ -843,7 +843,7 @@ class KeybindingsJsonSchema {
|
|
|
843
843
|
"type": "array"
|
|
844
844
|
},
|
|
845
845
|
"errorMessage": ( localize(
|
|
846
|
-
|
|
846
|
+
22002,
|
|
847
847
|
"Incorrect type. Expected \"{0}\". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.",
|
|
848
848
|
"string"
|
|
849
849
|
))
|
|
@@ -857,16 +857,16 @@ class KeybindingsJsonSchema {
|
|
|
857
857
|
},
|
|
858
858
|
"when": {
|
|
859
859
|
"type": "string",
|
|
860
|
-
"description": ( localize(
|
|
860
|
+
"description": ( localize(22003, "Condition when the key is active."))
|
|
861
861
|
},
|
|
862
862
|
"args": {
|
|
863
|
-
"description": ( localize(
|
|
863
|
+
"description": ( localize(22004, "Arguments to pass to the command to execute."))
|
|
864
864
|
},
|
|
865
865
|
"systemWide": {
|
|
866
866
|
"type": "boolean",
|
|
867
867
|
"default": false,
|
|
868
868
|
"markdownDescription": ( localize(
|
|
869
|
-
|
|
869
|
+
22005,
|
|
870
870
|
"When `true`, registers this keybinding as a system-wide (OS global) shortcut that fires even when the application is not focused. Desktop only. Only single key combinations are supported (no chords), and any `when` clause is ignored for the global trigger."
|
|
871
871
|
))
|
|
872
872
|
}
|
|
@@ -57,7 +57,7 @@ class BrowserKeyboardMapperFactoryBase extends Disposable {
|
|
|
57
57
|
return this._activeKeymapInfo?.mapping ?? null;
|
|
58
58
|
}
|
|
59
59
|
get keyboardLayouts() {
|
|
60
|
-
return
|
|
60
|
+
return this._keymapInfos.map(keymapInfo => keymapInfo.layout);
|
|
61
61
|
}
|
|
62
62
|
constructor(_configurationService) {
|
|
63
63
|
super();
|
|
@@ -332,12 +332,12 @@ class BrowserKeyboardMapperFactory extends BrowserKeyboardMapperFactoryBase {
|
|
|
332
332
|
const platform = isWindows ? "win" : isMacintosh ? "darwin" : "linux";
|
|
333
333
|
__variableDynamicImportRuntime0__(`./keyboardLayouts/layout.contribution.${platform}.js`).then(m => {
|
|
334
334
|
const keymapInfos = m.KeyboardLayoutContribution.INSTANCE.layoutInfos;
|
|
335
|
-
this._keymapInfos.push(...
|
|
335
|
+
this._keymapInfos.push(...keymapInfos.map(info => ( new KeymapInfo(
|
|
336
336
|
info.layout,
|
|
337
337
|
info.secondaryLayouts,
|
|
338
338
|
info.mapping,
|
|
339
339
|
info.isUserKeyboardLayout
|
|
340
|
-
))))
|
|
340
|
+
))));
|
|
341
341
|
this._mru = this._keymapInfos;
|
|
342
342
|
this._initialized = true;
|
|
343
343
|
this.setLayoutFromBrowserAPI();
|
|
@@ -480,12 +480,12 @@ const keyboardConfiguration = {
|
|
|
480
480
|
"id": "keyboard",
|
|
481
481
|
"order": 15,
|
|
482
482
|
"type": "object",
|
|
483
|
-
"title": ( localize(
|
|
483
|
+
"title": ( localize(22006, "Keyboard")),
|
|
484
484
|
"properties": {
|
|
485
485
|
"keyboard.layout": {
|
|
486
486
|
"type": "string",
|
|
487
487
|
"default": "autodetect",
|
|
488
|
-
"description": ( localize(
|
|
488
|
+
"description": ( localize(22007, "Control the keyboard layout used in web."))
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
};
|
|
@@ -794,7 +794,7 @@ class MacLinuxKeyboardMapper {
|
|
|
794
794
|
return this.keyCodeChordToScanCodeChord(chord);
|
|
795
795
|
}
|
|
796
796
|
resolveKeybinding(keybinding) {
|
|
797
|
-
const chords =
|
|
797
|
+
const chords = keybinding.chords.map(chord => this._resolveChord(chord));
|
|
798
798
|
return this._toResolvedKeybinding(chords);
|
|
799
799
|
}
|
|
800
800
|
static _redirectCharCode(charCode) {
|
|
@@ -348,7 +348,7 @@ class WindowsKeyboardMapper {
|
|
|
348
348
|
return ( new KeyCodeChord(chord.ctrlKey, chord.shiftKey, chord.altKey, chord.metaKey, keyCode));
|
|
349
349
|
}
|
|
350
350
|
resolveKeybinding(keybinding) {
|
|
351
|
-
const chords = toEmptyArrayIfContainsNull(
|
|
351
|
+
const chords = toEmptyArrayIfContainsNull(keybinding.chords.map(chord => this._resolveChord(chord)));
|
|
352
352
|
if (chords.length > 0) {
|
|
353
353
|
return [( new WindowsNativeResolvedKeybinding(this, chords))];
|
|
354
354
|
}
|