@codingame/monaco-vscode-keybindings-service-override 7.1.0 → 8.0.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/package.json +3 -3
- package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +5 -11
- package/vscode/src/vs/workbench/browser/contextkeys.js +10 -10
- package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +8 -11
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +2 -3
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +6 -9
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +183 -257
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +29 -63
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +3 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { onDidChangeFullscreen, isFullscreen } from 'vscode/vscode/vs/base/browser/browser';
|
|
4
4
|
import { BrowserFeatures, KeyboardSupport } from 'vscode/vscode/vs/base/browser/canIUse';
|
|
5
5
|
import { onDidRegisterWindow, addDisposableListener, EventType, trackFocus, getWindow } from 'vscode/vscode/vs/base/browser/dom';
|
|
@@ -46,64 +46,37 @@ import { OutputBuilder, KeybindingIO } from '../common/keybindingIO.js';
|
|
|
46
46
|
import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
47
47
|
|
|
48
48
|
var WorkbenchKeybindingService_1;
|
|
49
|
-
const _moduleId = "vs/workbench/services/keybinding/browser/keybindingService";
|
|
50
49
|
function isValidContributedKeyBinding(keyBinding, rejects) {
|
|
51
50
|
if (!keyBinding) {
|
|
52
|
-
rejects.push((
|
|
51
|
+
rejects.push(( localize(3025, "expected non-empty value.")));
|
|
53
52
|
return false;
|
|
54
53
|
}
|
|
55
54
|
if (typeof keyBinding.command !== 'string') {
|
|
56
|
-
rejects.push((
|
|
57
|
-
|
|
58
|
-
1,
|
|
55
|
+
rejects.push(( localize(
|
|
56
|
+
3026,
|
|
59
57
|
"property `{0}` is mandatory and must be of type `string`",
|
|
60
58
|
'command'
|
|
61
59
|
)));
|
|
62
60
|
return false;
|
|
63
61
|
}
|
|
64
62
|
if (keyBinding.key && typeof keyBinding.key !== 'string') {
|
|
65
|
-
rejects.push((
|
|
66
|
-
_moduleId,
|
|
67
|
-
2,
|
|
68
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
69
|
-
'key'
|
|
70
|
-
)));
|
|
63
|
+
rejects.push(( localize(3027, "property `{0}` can be omitted or must be of type `string`", 'key')));
|
|
71
64
|
return false;
|
|
72
65
|
}
|
|
73
66
|
if (keyBinding.when && typeof keyBinding.when !== 'string') {
|
|
74
|
-
rejects.push((
|
|
75
|
-
_moduleId,
|
|
76
|
-
2,
|
|
77
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
78
|
-
'when'
|
|
79
|
-
)));
|
|
67
|
+
rejects.push(( localize(3027, "property `{0}` can be omitted or must be of type `string`", 'when')));
|
|
80
68
|
return false;
|
|
81
69
|
}
|
|
82
70
|
if (keyBinding.mac && typeof keyBinding.mac !== 'string') {
|
|
83
|
-
rejects.push((
|
|
84
|
-
_moduleId,
|
|
85
|
-
2,
|
|
86
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
87
|
-
'mac'
|
|
88
|
-
)));
|
|
71
|
+
rejects.push(( localize(3027, "property `{0}` can be omitted or must be of type `string`", 'mac')));
|
|
89
72
|
return false;
|
|
90
73
|
}
|
|
91
74
|
if (keyBinding.linux && typeof keyBinding.linux !== 'string') {
|
|
92
|
-
rejects.push((
|
|
93
|
-
_moduleId,
|
|
94
|
-
2,
|
|
95
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
96
|
-
'linux'
|
|
97
|
-
)));
|
|
75
|
+
rejects.push(( localize(3027, "property `{0}` can be omitted or must be of type `string`", 'linux')));
|
|
98
76
|
return false;
|
|
99
77
|
}
|
|
100
78
|
if (keyBinding.win && typeof keyBinding.win !== 'string') {
|
|
101
|
-
rejects.push((
|
|
102
|
-
_moduleId,
|
|
103
|
-
2,
|
|
104
|
-
"property `{0}` can be omitted or must be of type `string`",
|
|
105
|
-
'win'
|
|
106
|
-
)));
|
|
79
|
+
rejects.push(( localize(3027, "property `{0}` can be omitted or must be of type `string`", 'win')));
|
|
107
80
|
return false;
|
|
108
81
|
}
|
|
109
82
|
return true;
|
|
@@ -113,38 +86,33 @@ const keybindingType = {
|
|
|
113
86
|
default: { command: '', key: '' },
|
|
114
87
|
properties: {
|
|
115
88
|
command: {
|
|
116
|
-
description: (
|
|
117
|
-
_moduleId,
|
|
118
|
-
3,
|
|
119
|
-
'Identifier of the command to run when keybinding is triggered.'
|
|
120
|
-
)),
|
|
89
|
+
description: ( localize(3028, 'Identifier of the command to run when keybinding is triggered.')),
|
|
121
90
|
type: 'string'
|
|
122
91
|
},
|
|
123
92
|
args: {
|
|
124
|
-
description: (
|
|
93
|
+
description: ( localize(3029, "Arguments to pass to the command to execute."))
|
|
125
94
|
},
|
|
126
95
|
key: {
|
|
127
|
-
description: (
|
|
128
|
-
|
|
129
|
-
5,
|
|
96
|
+
description: ( localize(
|
|
97
|
+
3030,
|
|
130
98
|
'Key or key sequence (separate keys with plus-sign and sequences with space, e.g. Ctrl+O and Ctrl+L L for a chord).'
|
|
131
99
|
)),
|
|
132
100
|
type: 'string'
|
|
133
101
|
},
|
|
134
102
|
mac: {
|
|
135
|
-
description: (
|
|
103
|
+
description: ( localize(3031, 'Mac specific key or key sequence.')),
|
|
136
104
|
type: 'string'
|
|
137
105
|
},
|
|
138
106
|
linux: {
|
|
139
|
-
description: (
|
|
107
|
+
description: ( localize(3032, 'Linux specific key or key sequence.')),
|
|
140
108
|
type: 'string'
|
|
141
109
|
},
|
|
142
110
|
win: {
|
|
143
|
-
description: (
|
|
111
|
+
description: ( localize(3033, 'Windows specific key or key sequence.')),
|
|
144
112
|
type: 'string'
|
|
145
113
|
},
|
|
146
114
|
when: {
|
|
147
|
-
description: (
|
|
115
|
+
description: ( localize(3034, 'Condition when the key is active.')),
|
|
148
116
|
type: 'string'
|
|
149
117
|
},
|
|
150
118
|
}
|
|
@@ -153,7 +121,7 @@ const keybindingsExtPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
|
153
121
|
extensionPoint: 'keybindings',
|
|
154
122
|
deps: [commandsExtensionPoint],
|
|
155
123
|
jsonSchema: {
|
|
156
|
-
description: (
|
|
124
|
+
description: ( localize(3035, "Contributes keybindings.")),
|
|
157
125
|
oneOf: [
|
|
158
126
|
keybindingType,
|
|
159
127
|
{
|
|
@@ -535,9 +503,8 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
535
503
|
}
|
|
536
504
|
}
|
|
537
505
|
if (rejects.length > 0) {
|
|
538
|
-
collector.error((
|
|
539
|
-
|
|
540
|
-
11,
|
|
506
|
+
collector.error(( localize(
|
|
507
|
+
3036,
|
|
541
508
|
"Invalid `contributes.{0}`: {1}",
|
|
542
509
|
keybindingsExtPoint.name,
|
|
543
510
|
rejects.join('\n')
|
|
@@ -627,7 +594,7 @@ let WorkbenchKeybindingService = WorkbenchKeybindingService_1 = class WorkbenchK
|
|
|
627
594
|
static _getAllCommandsAsComment(boundCommands) {
|
|
628
595
|
const unboundCommands = getAllUnboundCommands(boundCommands);
|
|
629
596
|
const pretty = unboundCommands.sort().join('\n// - ');
|
|
630
|
-
return '// ' + (
|
|
597
|
+
return '// ' + ( localize(3037, "Here are other available commands: ")) + '\n// - ' + pretty;
|
|
631
598
|
}
|
|
632
599
|
mightProducePrintableCharacter(event) {
|
|
633
600
|
if (event.ctrlKey || event.metaKey || event.altKey) {
|
|
@@ -752,7 +719,7 @@ class KeybindingsJsonSchema {
|
|
|
752
719
|
this.schema = {
|
|
753
720
|
id: KeybindingsJsonSchema.schemaId,
|
|
754
721
|
type: 'array',
|
|
755
|
-
title: (
|
|
722
|
+
title: ( localize(3038, "Keybindings configuration")),
|
|
756
723
|
allowTrailingCommas: true,
|
|
757
724
|
allowComments: true,
|
|
758
725
|
definitions: {
|
|
@@ -776,7 +743,7 @@ class KeybindingsJsonSchema {
|
|
|
776
743
|
'type': 'string',
|
|
777
744
|
'enum': this.commandsEnum,
|
|
778
745
|
'enumDescriptions': this.commandsEnumDescriptions,
|
|
779
|
-
'description': (
|
|
746
|
+
'description': ( localize(3039, "Name of the command to execute")),
|
|
780
747
|
},
|
|
781
748
|
'commandType': {
|
|
782
749
|
'anyOf': [
|
|
@@ -787,7 +754,7 @@ class KeybindingsJsonSchema {
|
|
|
787
754
|
'type': 'string',
|
|
788
755
|
'enum': this.removalCommandsEnum,
|
|
789
756
|
'enumDescriptions': this.commandsEnumDescriptions,
|
|
790
|
-
'description': (
|
|
757
|
+
'description': ( localize(3040, "Name of the command to remove keyboard shortcut for")),
|
|
791
758
|
},
|
|
792
759
|
{
|
|
793
760
|
'type': 'string'
|
|
@@ -805,7 +772,7 @@ class KeybindingsJsonSchema {
|
|
|
805
772
|
'properties': {
|
|
806
773
|
'key': {
|
|
807
774
|
'type': 'string',
|
|
808
|
-
'description': (
|
|
775
|
+
'description': ( localize(3041, "Key or key sequence (separated by space)")),
|
|
809
776
|
},
|
|
810
777
|
'command': {
|
|
811
778
|
'anyOf': [
|
|
@@ -817,9 +784,8 @@ class KeybindingsJsonSchema {
|
|
|
817
784
|
'not': {
|
|
818
785
|
'type': 'array'
|
|
819
786
|
},
|
|
820
|
-
'errorMessage': (
|
|
821
|
-
|
|
822
|
-
17,
|
|
787
|
+
'errorMessage': ( localize(
|
|
788
|
+
3042,
|
|
823
789
|
"Incorrect type. Expected \"{0}\". The field 'command' does not support running multiple commands. Use command 'runCommands' to pass it multiple commands to run.",
|
|
824
790
|
'string'
|
|
825
791
|
))
|
|
@@ -835,10 +801,10 @@ class KeybindingsJsonSchema {
|
|
|
835
801
|
},
|
|
836
802
|
'when': {
|
|
837
803
|
'type': 'string',
|
|
838
|
-
'description': (
|
|
804
|
+
'description': ( localize(3043, "Condition when the key is active."))
|
|
839
805
|
},
|
|
840
806
|
'args': {
|
|
841
|
-
'description': (
|
|
807
|
+
'description': ( localize(3044, "Arguments to pass to the command to execute."))
|
|
842
808
|
}
|
|
843
809
|
},
|
|
844
810
|
'$ref': '#/definitions/commandsSchemas'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
|
|
2
|
-
import {
|
|
2
|
+
import { localize } from 'vscode/vscode/vs/nls';
|
|
3
3
|
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { KeymapInfo } from '../common/keymapInfo.js';
|
|
@@ -36,7 +36,6 @@ function __variableDynamicImportRuntime0__(path) {
|
|
|
36
36
|
})
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
const _moduleId = "vs/workbench/services/keybinding/browser/keyboardLayoutService";
|
|
40
39
|
class BrowserKeyboardMapperFactoryBase extends Disposable {
|
|
41
40
|
get activeKeymap() {
|
|
42
41
|
return this._activeKeymapInfo;
|
|
@@ -493,12 +492,12 @@ const keyboardConfiguration = {
|
|
|
493
492
|
'id': 'keyboard',
|
|
494
493
|
'order': 15,
|
|
495
494
|
'type': 'object',
|
|
496
|
-
'title': (
|
|
495
|
+
'title': ( localize(3045, "Keyboard")),
|
|
497
496
|
'properties': {
|
|
498
497
|
'keyboard.layout': {
|
|
499
498
|
'type': 'string',
|
|
500
499
|
'default': 'autodetect',
|
|
501
|
-
'description': (
|
|
500
|
+
'description': ( localize(3046, "Control the keyboard layout used in web."))
|
|
502
501
|
}
|
|
503
502
|
}
|
|
504
503
|
};
|