@codingame/monaco-vscode-keybindings-service-override 4.5.1 → 4.5.2
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 +7 -10
- package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +8 -19
- package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +2 -5
- package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +21 -37
- package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +200 -569
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +89 -138
- package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +40 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-keybindings-service-override",
|
|
3
|
-
"version": "4.5.
|
|
3
|
+
"version": "4.5.2",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@4.5.
|
|
30
|
-
"@codingame/monaco-vscode-files-service-override": "4.5.
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@4.5.2",
|
|
30
|
+
"@codingame/monaco-vscode-files-service-override": "4.5.2"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -3,22 +3,19 @@ import { OS } from 'vscode/vscode/vs/base/common/platform';
|
|
|
3
3
|
import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
|
|
4
4
|
import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
|
|
5
5
|
|
|
6
|
+
const _moduleId = "vs/platform/keyboardLayout/common/keyboardConfig";
|
|
6
7
|
function readKeyboardConfig(configurationService) {
|
|
7
8
|
const keyboard = configurationService.getValue('keyboard');
|
|
8
9
|
const dispatch = ((keyboard?.dispatch === 'keyCode' ? 1 : 0) );
|
|
9
10
|
const mapAltGrToCtrlAlt = Boolean(keyboard?.mapAltGrToCtrlAlt);
|
|
10
11
|
return { dispatch, mapAltGrToCtrlAlt };
|
|
11
12
|
}
|
|
12
|
-
const configurationRegistry = ( Registry.as(Extensions.Configuration));
|
|
13
|
+
const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
|
|
13
14
|
const keyboardConfiguration = {
|
|
14
15
|
'id': 'keyboard',
|
|
15
16
|
'order': 15,
|
|
16
17
|
'type': 'object',
|
|
17
|
-
'title': ( localizeWithPath(
|
|
18
|
-
'vs/platform/keyboardLayout/common/keyboardConfig',
|
|
19
|
-
'keyboardConfigurationTitle',
|
|
20
|
-
"Keyboard"
|
|
21
|
-
)),
|
|
18
|
+
'title': ( localizeWithPath(_moduleId, 0, "Keyboard")),
|
|
22
19
|
'properties': {
|
|
23
20
|
'keyboard.dispatch': {
|
|
24
21
|
scope: 1 ,
|
|
@@ -26,8 +23,8 @@ const keyboardConfiguration = {
|
|
|
26
23
|
enum: ['code', 'keyCode'],
|
|
27
24
|
default: 'code',
|
|
28
25
|
markdownDescription: ( localizeWithPath(
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
_moduleId,
|
|
27
|
+
1,
|
|
31
28
|
"Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."
|
|
32
29
|
)),
|
|
33
30
|
included: OS === 2 || OS === 3
|
|
@@ -37,8 +34,8 @@ const keyboardConfiguration = {
|
|
|
37
34
|
type: 'boolean',
|
|
38
35
|
default: false,
|
|
39
36
|
markdownDescription: ( localizeWithPath(
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
_moduleId,
|
|
38
|
+
2,
|
|
42
39
|
"Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+."
|
|
43
40
|
)),
|
|
44
41
|
included: OS === 1
|
|
@@ -4,22 +4,15 @@ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/comma
|
|
|
4
4
|
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
|
|
5
5
|
import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
|
|
6
6
|
|
|
7
|
+
const _moduleId = "vs/workbench/contrib/commands/common/commands.contribution";
|
|
7
8
|
class RunCommands extends Action2 {
|
|
8
9
|
constructor() {
|
|
9
10
|
super({
|
|
10
11
|
id: 'runCommands',
|
|
11
|
-
title: ( localize2WithPath(
|
|
12
|
-
'vs/workbench/contrib/commands/common/commands.contribution',
|
|
13
|
-
'runCommands',
|
|
14
|
-
"Run Commands"
|
|
15
|
-
)),
|
|
12
|
+
title: ( localize2WithPath(_moduleId, 0, "Run Commands")),
|
|
16
13
|
f1: false,
|
|
17
14
|
metadata: {
|
|
18
|
-
description: ( localizeWithPath(
|
|
19
|
-
'vs/workbench/contrib/commands/common/commands.contribution',
|
|
20
|
-
'runCommands.description',
|
|
21
|
-
"Run several commands"
|
|
22
|
-
)),
|
|
15
|
+
description: ( localizeWithPath(_moduleId, 1, "Run several commands")),
|
|
23
16
|
args: [
|
|
24
17
|
{
|
|
25
18
|
name: 'args',
|
|
@@ -29,11 +22,7 @@ class RunCommands extends Action2 {
|
|
|
29
22
|
properties: {
|
|
30
23
|
commands: {
|
|
31
24
|
type: 'array',
|
|
32
|
-
description: ( localizeWithPath(
|
|
33
|
-
'vs/workbench/contrib/commands/common/commands.contribution',
|
|
34
|
-
'runCommands.commands',
|
|
35
|
-
"Commands to run"
|
|
36
|
-
)),
|
|
25
|
+
description: ( localizeWithPath(_moduleId, 2, "Commands to run")),
|
|
37
26
|
items: {
|
|
38
27
|
anyOf: [
|
|
39
28
|
{
|
|
@@ -73,16 +62,16 @@ class RunCommands extends Action2 {
|
|
|
73
62
|
const notificationService = accessor.get(INotificationService);
|
|
74
63
|
if (!this._isCommandArgs(args)) {
|
|
75
64
|
notificationService.error(( localizeWithPath(
|
|
76
|
-
|
|
77
|
-
|
|
65
|
+
_moduleId,
|
|
66
|
+
3,
|
|
78
67
|
"'runCommands' has received an argument with incorrect type. Please, review the argument passed to the command."
|
|
79
68
|
)));
|
|
80
69
|
return;
|
|
81
70
|
}
|
|
82
71
|
if (args.commands.length === 0) {
|
|
83
72
|
notificationService.warn(( localizeWithPath(
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
_moduleId,
|
|
74
|
+
4,
|
|
86
75
|
"'runCommands' has not received commands to run. Did you forget to pass commands in the 'runCommands' argument?"
|
|
87
76
|
)));
|
|
88
77
|
return;
|
|
@@ -5,15 +5,12 @@ import { Categories } from 'vscode/vscode/vs/platform/action/common/actionCommon
|
|
|
5
5
|
import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
|
|
6
6
|
import { showWindowLogActionId } from 'vscode/vscode/vs/workbench/services/log/common/logConstants';
|
|
7
7
|
|
|
8
|
+
const _moduleId = "vs/workbench/contrib/keybindings/browser/keybindings.contribution";
|
|
8
9
|
class ToggleKeybindingsLogAction extends Action2 {
|
|
9
10
|
constructor() {
|
|
10
11
|
super({
|
|
11
12
|
id: 'workbench.action.toggleKeybindingsLog',
|
|
12
|
-
title: ( localize2WithPath(
|
|
13
|
-
'vs/workbench/contrib/keybindings/browser/keybindings.contribution',
|
|
14
|
-
'toggleKeybindingsLog',
|
|
15
|
-
"Toggle Keyboard Shortcuts Troubleshooting"
|
|
16
|
-
)),
|
|
13
|
+
title: ( localize2WithPath(_moduleId, 0, "Toggle Keyboard Shortcuts Troubleshooting")),
|
|
17
14
|
category: Categories.Developer,
|
|
18
15
|
f1: true
|
|
19
16
|
});
|
package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js
CHANGED
|
@@ -22,9 +22,10 @@ import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/use
|
|
|
22
22
|
import { DEFINE_KEYBINDING_EDITOR_CONTRIB_ID } from 'vscode/vscode/vs/workbench/services/preferences/common/preferences';
|
|
23
23
|
|
|
24
24
|
var KeybindingEditorDecorationsRenderer_1;
|
|
25
|
+
const _moduleId = "vs/workbench/contrib/preferences/browser/keybindingsEditorContribution";
|
|
25
26
|
const NLS_KB_LAYOUT_ERROR_MESSAGE = ( localizeWithPath(
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
_moduleId,
|
|
28
|
+
0,
|
|
28
29
|
"You won't be able to produce this key combination under your current keyboard layout."
|
|
29
30
|
));
|
|
30
31
|
let DefineKeybindingEditorContribution = class DefineKeybindingEditorContribution extends Disposable {
|
|
@@ -33,7 +34,7 @@ let DefineKeybindingEditorContribution = class DefineKeybindingEditorContributio
|
|
|
33
34
|
this._editor = _editor;
|
|
34
35
|
this._instantiationService = _instantiationService;
|
|
35
36
|
this._userDataProfileService = _userDataProfileService;
|
|
36
|
-
this._keybindingDecorationRenderer = this._register(( new MutableDisposable()));
|
|
37
|
+
this._keybindingDecorationRenderer = this._register(( (new MutableDisposable())));
|
|
37
38
|
this._defineWidget = this._register(this._instantiationService.createInstance(DefineKeybindingOverlayWidget, this._editor));
|
|
38
39
|
this._register(this._editor.onDidChangeModel(e => this._update()));
|
|
39
40
|
this._update();
|
|
@@ -51,7 +52,7 @@ let DefineKeybindingEditorContribution = class DefineKeybindingEditorContributio
|
|
|
51
52
|
_onAccepted(keybinding) {
|
|
52
53
|
this._editor.focus();
|
|
53
54
|
if (keybinding && this._editor.hasModel()) {
|
|
54
|
-
const regexp = ( new RegExp(/\\/g));
|
|
55
|
+
const regexp = ( (new RegExp(/\\/g)));
|
|
55
56
|
const backslash = regexp.test(keybinding);
|
|
56
57
|
if (backslash) {
|
|
57
58
|
keybinding = keybinding.slice(0, -1) + '\\\\';
|
|
@@ -70,17 +71,17 @@ let DefineKeybindingEditorContribution = class DefineKeybindingEditorContributio
|
|
|
70
71
|
}
|
|
71
72
|
}
|
|
72
73
|
};
|
|
73
|
-
DefineKeybindingEditorContribution = ( __decorate([
|
|
74
|
-
( __param(1, IInstantiationService)),
|
|
75
|
-
( __param(2, IUserDataProfileService))
|
|
76
|
-
], DefineKeybindingEditorContribution));
|
|
74
|
+
DefineKeybindingEditorContribution = ( (__decorate([
|
|
75
|
+
( (__param(1, IInstantiationService))),
|
|
76
|
+
( (__param(2, IUserDataProfileService)))
|
|
77
|
+
], DefineKeybindingEditorContribution)));
|
|
77
78
|
let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1 = class KeybindingEditorDecorationsRenderer extends Disposable {
|
|
78
79
|
constructor(_editor, _keybindingService) {
|
|
79
80
|
super();
|
|
80
81
|
this._editor = _editor;
|
|
81
82
|
this._keybindingService = _keybindingService;
|
|
82
83
|
this._dec = this._editor.createDecorationsCollection();
|
|
83
|
-
this._updateDecorations = this._register(( new RunOnceScheduler(() => this._updateDecorationsNow(), 500)));
|
|
84
|
+
this._updateDecorations = this._register(( (new RunOnceScheduler(() => this._updateDecorationsNow(), 500))));
|
|
84
85
|
const model = assertIsDefined(this._editor.getModel());
|
|
85
86
|
this._register(model.onDidChangeContent(() => this._updateDecorations.schedule()));
|
|
86
87
|
this._register(this._keybindingService.onDidUpdateKeybindings(() => this._updateDecorations.schedule()));
|
|
@@ -175,51 +176,34 @@ let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1
|
|
|
175
176
|
let className;
|
|
176
177
|
let overviewRulerColor;
|
|
177
178
|
if (isError) {
|
|
178
|
-
msg = ( new MarkdownString()).appendText(NLS_KB_LAYOUT_ERROR_MESSAGE);
|
|
179
|
+
msg = ( (new MarkdownString())).appendText(NLS_KB_LAYOUT_ERROR_MESSAGE);
|
|
179
180
|
className = 'keybindingError';
|
|
180
181
|
overviewRulerColor = themeColorFromId(overviewRulerError);
|
|
181
182
|
}
|
|
182
183
|
else {
|
|
183
184
|
if (usLabel && uiLabel !== usLabel) {
|
|
184
|
-
msg = ( new MarkdownString(( localizeWithPath(
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
key: 'defineKeybinding.kbLayoutLocalAndUSMessage',
|
|
188
|
-
comment: [
|
|
189
|
-
'Please translate maintaining the stars (*) around the placeholders such that they will be rendered in bold.',
|
|
190
|
-
'The placeholders will contain a keyboard combination e.g. Ctrl+Shift+/'
|
|
191
|
-
]
|
|
192
|
-
},
|
|
185
|
+
msg = ( (new MarkdownString(( localizeWithPath(
|
|
186
|
+
_moduleId,
|
|
187
|
+
1,
|
|
193
188
|
"**{0}** for your current keyboard layout (**{1}** for US standard).",
|
|
194
189
|
uiLabel,
|
|
195
190
|
usLabel
|
|
196
|
-
))));
|
|
191
|
+
)))));
|
|
197
192
|
}
|
|
198
193
|
else {
|
|
199
|
-
msg = ( new MarkdownString(( localizeWithPath(
|
|
200
|
-
'vs/workbench/contrib/preferences/browser/keybindingsEditorContribution',
|
|
201
|
-
{
|
|
202
|
-
key: 'defineKeybinding.kbLayoutLocalMessage',
|
|
203
|
-
comment: [
|
|
204
|
-
'Please translate maintaining the stars (*) around the placeholder such that it will be rendered in bold.',
|
|
205
|
-
'The placeholder will contain a keyboard combination e.g. Ctrl+Shift+/'
|
|
206
|
-
]
|
|
207
|
-
},
|
|
208
|
-
"**{0}** for your current keyboard layout.",
|
|
209
|
-
uiLabel
|
|
210
|
-
))));
|
|
194
|
+
msg = ( (new MarkdownString(( localizeWithPath(_moduleId, 2, "**{0}** for your current keyboard layout.", uiLabel)))));
|
|
211
195
|
}
|
|
212
196
|
className = 'keybindingInfo';
|
|
213
197
|
overviewRulerColor = themeColorFromId(overviewRulerInfo);
|
|
214
198
|
}
|
|
215
199
|
const startPosition = model.getPositionAt(keyNode.offset);
|
|
216
200
|
const endPosition = model.getPositionAt(keyNode.offset + keyNode.length);
|
|
217
|
-
const range = ( new Range(
|
|
201
|
+
const range = ( (new Range(
|
|
218
202
|
startPosition.lineNumber,
|
|
219
203
|
startPosition.column,
|
|
220
204
|
endPosition.lineNumber,
|
|
221
205
|
endPosition.column
|
|
222
|
-
));
|
|
206
|
+
)));
|
|
223
207
|
return {
|
|
224
208
|
range: range,
|
|
225
209
|
options: {
|
|
@@ -235,9 +219,9 @@ let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1
|
|
|
235
219
|
};
|
|
236
220
|
}
|
|
237
221
|
};
|
|
238
|
-
KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1 = ( __decorate([
|
|
239
|
-
( __param(1, IKeybindingService))
|
|
240
|
-
], KeybindingEditorDecorationsRenderer));
|
|
222
|
+
KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1 = ( (__decorate([
|
|
223
|
+
( (__param(1, IKeybindingService)))
|
|
224
|
+
], KeybindingEditorDecorationsRenderer)));
|
|
241
225
|
function isInterestingEditorModel(editor, userDataProfileService) {
|
|
242
226
|
const model = editor.getModel();
|
|
243
227
|
if (!model) {
|