@codingame/monaco-vscode-keybindings-service-override 23.2.2 → 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.d.ts +9 -2
- package/index.js +21 -15
- 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.d.ts +1 -0
- package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +36 -33
- 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
package/index.d.ts
CHANGED
|
@@ -11,9 +11,16 @@ declare function initUserKeybindings(configurationJson: string, options?: Partia
|
|
|
11
11
|
* Can be called at any time after the services are initialized to update the user configuration
|
|
12
12
|
*/
|
|
13
13
|
declare function updateUserKeybindings(keybindingsJson: string): Promise<void>;
|
|
14
|
-
interface
|
|
14
|
+
export interface LockKeyCodesOverride {
|
|
15
|
+
(keyCodes: string[], next: (keyCodes: string[]) => void): void;
|
|
16
|
+
}
|
|
17
|
+
export interface KeybindingsProps {
|
|
15
18
|
shouldUseGlobalKeybindings?: () => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Allows to override the key code lock (for instance, ['Escape'] during full screen)
|
|
21
|
+
*/
|
|
22
|
+
lockKeyCodesOverride?: LockKeyCodesOverride;
|
|
16
23
|
}
|
|
17
|
-
export default function getServiceOverride({ shouldUseGlobalKeybindings }?: KeybindingsProps): IEditorOverrideServices;
|
|
24
|
+
export default function getServiceOverride({ shouldUseGlobalKeybindings, lockKeyCodesOverride }?: KeybindingsProps): IEditorOverrideServices;
|
|
18
25
|
export { defaultUserKeybindindsFile, initUserKeybindings, updateUserKeybindings };
|
|
19
26
|
export type { IUserFriendlyKeybinding };
|
package/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log
|
|
|
23
23
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
24
24
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
25
25
|
import getServiceOverride$1, { initFile } from '@codingame/monaco-vscode-files-service-override';
|
|
26
|
-
import '@codingame/monaco-vscode-
|
|
26
|
+
import '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/workbench.contribution';
|
|
27
27
|
import './vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js';
|
|
28
28
|
import './vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js';
|
|
29
29
|
import './vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js';
|
|
@@ -42,9 +42,10 @@ async function updateUserKeybindings(keybindingsJson) {
|
|
|
42
42
|
await fileService.writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsJson));
|
|
43
43
|
}
|
|
44
44
|
let DynamicWorkbenchKeybindingService = class DynamicWorkbenchKeybindingService extends WorkbenchKeybindingService {
|
|
45
|
-
constructor(shouldUseGlobalKeybindings, contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService) {
|
|
45
|
+
constructor(shouldUseGlobalKeybindings, _lockKeyCodesOverride, contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService) {
|
|
46
46
|
super(contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService);
|
|
47
47
|
this.shouldUseGlobalKeybindings = shouldUseGlobalKeybindings;
|
|
48
|
+
this._lockKeyCodesOverride = _lockKeyCodesOverride;
|
|
48
49
|
this.keybindingProviders = [];
|
|
49
50
|
this.authorizedContainers = [];
|
|
50
51
|
}
|
|
@@ -89,24 +90,29 @@ let DynamicWorkbenchKeybindingService = class DynamicWorkbenchKeybindingService
|
|
|
89
90
|
...this.keybindingProviders.flatMap((provider) => provider.provideKeybindings())
|
|
90
91
|
];
|
|
91
92
|
}
|
|
93
|
+
lockKeyCodes(keyCodes) {
|
|
94
|
+
this._lockKeyCodesOverride(keyCodes, (keyCodes) => super.lockKeyCodes(keyCodes));
|
|
95
|
+
}
|
|
92
96
|
};
|
|
93
97
|
DynamicWorkbenchKeybindingService = __decorate([
|
|
94
|
-
__param(
|
|
95
|
-
__param(
|
|
96
|
-
__param(
|
|
97
|
-
__param(
|
|
98
|
-
__param(
|
|
99
|
-
__param(
|
|
100
|
-
__param(
|
|
101
|
-
__param(
|
|
102
|
-
__param(
|
|
103
|
-
__param(
|
|
104
|
-
__param(
|
|
98
|
+
__param(2, IContextKeyService),
|
|
99
|
+
__param(3, ICommandService),
|
|
100
|
+
__param(4, ITelemetryService),
|
|
101
|
+
__param(5, INotificationService),
|
|
102
|
+
__param(6, IUserDataProfileService),
|
|
103
|
+
__param(7, IHostService),
|
|
104
|
+
__param(8, IExtensionService),
|
|
105
|
+
__param(9, IFileService),
|
|
106
|
+
__param(10, IUriIdentityService),
|
|
107
|
+
__param(11, ILogService),
|
|
108
|
+
__param(12, IKeyboardLayoutService)
|
|
105
109
|
], DynamicWorkbenchKeybindingService);
|
|
106
|
-
function getServiceOverride({ shouldUseGlobalKeybindings = () => false
|
|
110
|
+
function getServiceOverride({ shouldUseGlobalKeybindings = () => false, lockKeyCodesOverride = (keyCodes, next) => {
|
|
111
|
+
next(keyCodes);
|
|
112
|
+
} } = {}) {
|
|
107
113
|
return {
|
|
108
114
|
...getServiceOverride$1(),
|
|
109
|
-
[IKeybindingService.toString()]: new SyncDescriptor(DynamicWorkbenchKeybindingService, [shouldUseGlobalKeybindings], false),
|
|
115
|
+
[IKeybindingService.toString()]: new SyncDescriptor(DynamicWorkbenchKeybindingService, [shouldUseGlobalKeybindings, lockKeyCodesOverride], false),
|
|
110
116
|
[IKeyboardLayoutService.toString()]: new SyncDescriptor(BrowserKeyboardLayoutService, [], true),
|
|
111
117
|
[ICommandService.toString()]: new SyncDescriptor(CommandService, [], true)
|
|
112
118
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-keybindings-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "24.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - keybindings service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,13 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-
|
|
19
|
-
"@codingame/monaco-vscode-
|
|
20
|
-
"@codingame/monaco-vscode-40cada32-7e9c-528a-81fc-766e4da54147-common": "23.2.2",
|
|
21
|
-
"@codingame/monaco-vscode-a3eaa464-944c-5b8f-8886-213068ba4897-common": "23.2.2",
|
|
22
|
-
"@codingame/monaco-vscode-api": "23.2.2",
|
|
23
|
-
"@codingame/monaco-vscode-d609a7d3-bf87-551a-884f-550a8b327ec5-common": "23.2.2",
|
|
24
|
-
"@codingame/monaco-vscode-files-service-override": "23.2.2"
|
|
18
|
+
"@codingame/monaco-vscode-api": "24.1.0",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "24.1.0"
|
|
25
20
|
},
|
|
26
21
|
"main": "index.js",
|
|
27
22
|
"module": "index.js",
|
|
@@ -20,7 +20,7 @@ const keyboardConfiguration = {
|
|
|
20
20
|
'id': 'keyboard',
|
|
21
21
|
'order': 15,
|
|
22
22
|
'type': 'object',
|
|
23
|
-
'title': ( localize(
|
|
23
|
+
'title': ( localize(1945, "Keyboard")),
|
|
24
24
|
'properties': {
|
|
25
25
|
'keyboard.dispatch': {
|
|
26
26
|
scope: ConfigurationScope.APPLICATION,
|
|
@@ -28,7 +28,7 @@ const keyboardConfiguration = {
|
|
|
28
28
|
enum: ['code', 'keyCode'],
|
|
29
29
|
default: 'code',
|
|
30
30
|
markdownDescription: ( localize(
|
|
31
|
-
|
|
31
|
+
1946,
|
|
32
32
|
"Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."
|
|
33
33
|
)),
|
|
34
34
|
included: OS === OperatingSystem.Macintosh || OS === OperatingSystem.Linux
|
|
@@ -37,7 +37,7 @@ const keyboardConfiguration = {
|
|
|
37
37
|
scope: ConfigurationScope.APPLICATION,
|
|
38
38
|
type: 'boolean',
|
|
39
39
|
default: false,
|
|
40
|
-
markdownDescription: ( localize(
|
|
40
|
+
markdownDescription: ( localize(1947, "Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+.")),
|
|
41
41
|
included: OS === OperatingSystem.Windows
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -10,10 +10,10 @@ class RunCommands extends Action2 {
|
|
|
10
10
|
constructor() {
|
|
11
11
|
super({
|
|
12
12
|
id: 'runCommands',
|
|
13
|
-
title: ( localize2(
|
|
13
|
+
title: ( localize2(6257, "Run Commands")),
|
|
14
14
|
f1: false,
|
|
15
15
|
metadata: {
|
|
16
|
-
description: ( localize(
|
|
16
|
+
description: ( localize(6258, "Run several commands")),
|
|
17
17
|
args: [
|
|
18
18
|
{
|
|
19
19
|
name: 'args',
|
|
@@ -23,7 +23,7 @@ class RunCommands extends Action2 {
|
|
|
23
23
|
properties: {
|
|
24
24
|
commands: {
|
|
25
25
|
type: 'array',
|
|
26
|
-
description: ( localize(
|
|
26
|
+
description: ( localize(6259, "Commands to run")),
|
|
27
27
|
items: {
|
|
28
28
|
anyOf: [
|
|
29
29
|
{
|
|
@@ -63,14 +63,14 @@ class RunCommands extends Action2 {
|
|
|
63
63
|
const notificationService = accessor.get(INotificationService);
|
|
64
64
|
if (!this._isCommandArgs(args)) {
|
|
65
65
|
notificationService.error(( localize(
|
|
66
|
-
|
|
66
|
+
6260,
|
|
67
67
|
"'runCommands' has received an argument with incorrect type. Please, review the argument passed to the command."
|
|
68
68
|
)));
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
if (args.commands.length === 0) {
|
|
72
72
|
notificationService.warn(( localize(
|
|
73
|
-
|
|
73
|
+
6261,
|
|
74
74
|
"'runCommands' has not received commands to run. Did you forget to pass commands in the 'runCommands' argument?"
|
|
75
75
|
)));
|
|
76
76
|
return;
|
|
@@ -15,7 +15,7 @@ class ToggleKeybindingsLogAction extends Action2 {
|
|
|
15
15
|
constructor() {
|
|
16
16
|
super({
|
|
17
17
|
id: 'workbench.action.toggleKeybindingsLog',
|
|
18
|
-
title: ( localize2(
|
|
18
|
+
title: ( localize2(8477, "Toggle Keyboard Shortcuts Troubleshooting")),
|
|
19
19
|
category: Categories.Developer,
|
|
20
20
|
f1: true
|
|
21
21
|
});
|
package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js
CHANGED
|
@@ -10,21 +10,21 @@ import { Range } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core
|
|
|
10
10
|
import { registerEditorContribution, EditorContributionInstantiation } from '@codingame/monaco-vscode-api/vscode/vs/editor/browser/editorExtensions';
|
|
11
11
|
import { SnippetController2 } from '@codingame/monaco-vscode-api/vscode/vs/editor/contrib/snippet/browser/snippetController2';
|
|
12
12
|
import { SmartSnippetInserter } from '../common/smartSnippetInserter.js';
|
|
13
|
-
import { DefineKeybindingOverlayWidget } from '@codingame/monaco-vscode-
|
|
13
|
+
import { DefineKeybindingOverlayWidget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/preferences/browser/keybindingWidgets';
|
|
14
14
|
import { parseTree } from '@codingame/monaco-vscode-api/vscode/vs/base/common/json';
|
|
15
15
|
import { WindowsNativeResolvedKeybinding } from '../../../services/keybinding/common/windowsKeyboardMapper.js';
|
|
16
16
|
import { themeColorFromId } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
17
17
|
import { overviewRulerError, overviewRulerInfo } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/core/editorColorRegistry';
|
|
18
18
|
import { OverviewRulerLane, TrackedRangeStickiness } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/model';
|
|
19
|
-
import { KeybindingParser } from '@codingame/monaco-vscode-
|
|
19
|
+
import { KeybindingParser } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keybindingParser';
|
|
20
20
|
import { assertReturnsDefined } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
21
21
|
import { isEqual } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
22
22
|
import { IUserDataProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
|
|
23
|
-
import { DEFINE_KEYBINDING_EDITOR_CONTRIB_ID } from '@codingame/monaco-vscode-
|
|
23
|
+
import { DEFINE_KEYBINDING_EDITOR_CONTRIB_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences';
|
|
24
24
|
|
|
25
25
|
var KeybindingEditorDecorationsRenderer_1;
|
|
26
26
|
const NLS_KB_LAYOUT_ERROR_MESSAGE = ( localize(
|
|
27
|
-
|
|
27
|
+
9841,
|
|
28
28
|
"You won't be able to produce this key combination under your current keyboard layout."
|
|
29
29
|
));
|
|
30
30
|
let DefineKeybindingEditorContribution = class DefineKeybindingEditorContribution extends Disposable {
|
|
@@ -182,14 +182,14 @@ let KeybindingEditorDecorationsRenderer = KeybindingEditorDecorationsRenderer_1
|
|
|
182
182
|
else {
|
|
183
183
|
if (usLabel && uiLabel !== usLabel) {
|
|
184
184
|
msg = ( new MarkdownString(( localize(
|
|
185
|
-
|
|
185
|
+
9842,
|
|
186
186
|
"**{0}** for your current keyboard layout (**{1}** for US standard).",
|
|
187
187
|
uiLabel,
|
|
188
188
|
usLabel
|
|
189
189
|
))));
|
|
190
190
|
}
|
|
191
191
|
else {
|
|
192
|
-
msg = ( new MarkdownString(( localize(
|
|
192
|
+
msg = ( new MarkdownString(( localize(9843, "**{0}** for your current keyboard layout.", uiLabel))));
|
|
193
193
|
}
|
|
194
194
|
className = 'keybindingInfo';
|
|
195
195
|
overviewRulerColor = themeColorFromId(overviewRulerInfo);
|