@codingame/monaco-vscode-keybindings-service-override 11.1.2 → 12.0.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.
Files changed (128) hide show
  1. package/index.d.ts +19 -2
  2. package/index.js +110 -1
  3. package/package.json +21 -8
  4. package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.d.ts +10 -0
  5. package/vscode/src/vs/platform/keyboardLayout/common/keyboardConfig.js +18 -12
  6. package/vscode/src/vs/platform/keyboardLayout/common/keyboardMapper.d.ts +15 -0
  7. package/vscode/src/vs/platform/keyboardLayout/common/keyboardMapper.js +2 -0
  8. package/vscode/src/vs/workbench/browser/contextkeys.d.ts +67 -0
  9. package/vscode/src/vs/workbench/browser/contextkeys.js +17 -16
  10. package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.d.ts +1 -0
  11. package/vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js +6 -5
  12. package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.d.ts +1 -0
  13. package/vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js +2 -1
  14. package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.d.ts +14 -0
  15. package/vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js +27 -26
  16. package/vscode/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.d.ts +12 -0
  17. package/vscode/src/vs/workbench/contrib/preferences/common/smartSnippetInserter.js +14 -13
  18. package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.d.ts +44 -0
  19. package/vscode/src/vs/workbench/services/actions/common/menusExtensionPoint.js +183 -159
  20. package/vscode/src/vs/workbench/services/commands/common/commandService.d.ts +23 -0
  21. package/vscode/src/vs/workbench/services/commands/common/commandService.js +3 -1
  22. package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.d.ts +58 -0
  23. package/vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js +130 -129
  24. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.d.ts +69 -0
  25. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js +37 -45
  26. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.d.ts +8 -0
  27. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/_.contribution.js +2 -0
  28. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.d.ts +1 -0
  29. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/cz.win.js +1 -0
  30. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.d.ts +1 -0
  31. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de-swiss.win.js +1 -0
  32. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.d.ts +1 -0
  33. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.darwin.js +1 -0
  34. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.d.ts +1 -0
  35. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.linux.js +1 -0
  36. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.d.ts +1 -0
  37. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/de.win.js +1 -0
  38. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.d.ts +1 -0
  39. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dk.win.js +1 -0
  40. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.d.ts +1 -0
  41. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/dvorak.darwin.js +1 -0
  42. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.d.ts +1 -0
  43. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-belgian.win.js +1 -0
  44. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.d.ts +1 -0
  45. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-ext.darwin.js +1 -0
  46. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.d.ts +1 -0
  47. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-in.win.js +1 -0
  48. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.d.ts +1 -0
  49. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.darwin.js +1 -0
  50. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.d.ts +1 -0
  51. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-intl.win.js +1 -0
  52. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.d.ts +1 -0
  53. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.darwin.js +1 -0
  54. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.d.ts +1 -0
  55. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en-uk.win.js +1 -0
  56. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.d.ts +1 -0
  57. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.darwin.js +1 -0
  58. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.d.ts +1 -0
  59. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.linux.js +1 -0
  60. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.d.ts +1 -0
  61. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/en.win.js +1 -0
  62. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.d.ts +1 -0
  63. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es-latin.win.js +1 -0
  64. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.d.ts +1 -0
  65. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.darwin.js +1 -0
  66. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.d.ts +1 -0
  67. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.linux.js +1 -0
  68. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.d.ts +1 -0
  69. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/es.win.js +1 -0
  70. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.d.ts +1 -0
  71. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.darwin.js +1 -0
  72. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.d.ts +1 -0
  73. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.linux.js +1 -0
  74. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.d.ts +1 -0
  75. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/fr.win.js +1 -0
  76. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.d.ts +1 -0
  77. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/hu.win.js +1 -0
  78. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.d.ts +1 -0
  79. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.darwin.js +1 -0
  80. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.d.ts +1 -0
  81. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/it.win.js +1 -0
  82. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.d.ts +1 -0
  83. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp-roman.darwin.js +1 -0
  84. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.d.ts +1 -0
  85. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/jp.darwin.js +1 -0
  86. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.d.ts +1 -0
  87. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ko.darwin.js +1 -0
  88. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.d.ts +1 -0
  89. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.darwin.js +1 -0
  90. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.d.ts +1 -0
  91. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.linux.js +1 -0
  92. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.d.ts +1 -0
  93. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/layout.contribution.win.js +1 -0
  94. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.d.ts +1 -0
  95. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/no.win.js +1 -0
  96. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.d.ts +1 -0
  97. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.darwin.js +1 -0
  98. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.d.ts +1 -0
  99. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pl.win.js +1 -0
  100. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.d.ts +1 -0
  101. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt-br.win.js +1 -0
  102. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.d.ts +1 -0
  103. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.darwin.js +1 -0
  104. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.d.ts +1 -0
  105. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/pt.win.js +1 -0
  106. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.d.ts +1 -0
  107. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.darwin.js +1 -0
  108. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.d.ts +1 -0
  109. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.linux.js +1 -0
  110. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.d.ts +1 -0
  111. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/ru.win.js +1 -0
  112. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.d.ts +1 -0
  113. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/sv.win.js +1 -0
  114. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.d.ts +1 -0
  115. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/thai.win.js +1 -0
  116. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.d.ts +1 -0
  117. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/tr.win.js +1 -0
  118. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.d.ts +1 -0
  119. package/vscode/src/vs/workbench/services/keybinding/browser/keyboardLayouts/zh-hans.darwin.js +1 -0
  120. package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.d.ts +21 -0
  121. package/vscode/src/vs/workbench/services/keybinding/common/keybindingIO.js +2 -1
  122. package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.d.ts +35 -0
  123. package/vscode/src/vs/workbench/services/keybinding/common/keymapInfo.js +2 -1
  124. package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.d.ts +43 -0
  125. package/vscode/src/vs/workbench/services/keybinding/common/macLinuxKeyboardMapper.js +176 -178
  126. package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.d.ts +49 -0
  127. package/vscode/src/vs/workbench/services/keybinding/common/windowsKeyboardMapper.js +71 -68
  128. package/keybindings.js +0 -108
package/index.d.ts CHANGED
@@ -1,2 +1,19 @@
1
- export * from 'vscode/service-override/keybindings';
2
- export { default } from 'vscode/service-override/keybindings';
1
+ import type { IEditorOverrideServices } from "vscode/vscode/vs/editor/standalone/browser/standaloneServices";
2
+ import type { IUserFriendlyKeybinding } from "vscode/vscode/vs/platform/keybinding/common/keybinding";
3
+ import type { IFileWriteOptions } from "vscode/vscode/vs/platform/files/common/files";
4
+ import { URI } from "vscode/vscode/vs/base/common/uri";
5
+ declare const defaultUserKeybindindsFile: URI;
6
+ /**
7
+ * Should be called only BEFORE the service are initialized to initialize the file on the filesystem before the keybindings service initializes
8
+ */
9
+ declare function initUserKeybindings(configurationJson: string, options?: Partial<IFileWriteOptions>, file?: URI): Promise<void>;
10
+ /**
11
+ * Can be called at any time after the services are initialized to update the user configuration
12
+ */
13
+ declare function updateUserKeybindings(keybindingsJson: string): Promise<void>;
14
+ interface KeybindingsProps {
15
+ shouldUseGlobalKeybindings?: () => boolean;
16
+ }
17
+ export default function getServiceOverride({ shouldUseGlobalKeybindings }?: KeybindingsProps): IEditorOverrideServices;
18
+ export { defaultUserKeybindindsFile, initUserKeybindings, updateUserKeybindings };
19
+ export type { IUserFriendlyKeybinding };
package/index.js CHANGED
@@ -1 +1,110 @@
1
- export { default, defaultUserKeybindindsFile, initUserKeybindings, updateUserKeybindings } from './keybindings.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
3
+ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
4
+ import { WorkbenchKeybindingService } from './vscode/src/vs/workbench/services/keybinding/browser/keybindingService.js';
5
+ import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
6
+ import { VSBuffer } from 'vscode/vscode/vs/base/common/buffer';
7
+ import { IUserDataProfilesService } from 'vscode/vscode/vs/platform/userDataProfile/common/userDataProfile.service';
8
+ import { IKeyboardLayoutService } from 'vscode/vscode/vs/platform/keyboardLayout/common/keyboardLayout.service';
9
+ import { BrowserKeyboardLayoutService } from './vscode/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.js';
10
+ import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
11
+ import { ICommandService } from 'vscode/vscode/vs/platform/commands/common/commands.service';
12
+ import { CommandService } from './vscode/src/vs/workbench/services/commands/common/commandService.js';
13
+ import { DisposableStore, toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
14
+ import 'vscode/vscode/vs/platform/keybinding/common/keybindingResolver';
15
+ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey.service';
16
+ import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity.service';
17
+ import { ITelemetryService } from 'vscode/vscode/vs/platform/telemetry/common/telemetry.service';
18
+ import { INotificationService } from 'vscode/vscode/vs/platform/notification/common/notification.service';
19
+ import { IUserDataProfileService } from 'vscode/vscode/vs/workbench/services/userDataProfile/common/userDataProfile.service';
20
+ import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host.service';
21
+ import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
22
+ import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
23
+ import { WorkbenchContextKeysHandler } from './vscode/src/vs/workbench/browser/contextkeys.js';
24
+ import { Schemas } from 'vscode/vscode/vs/base/common/network';
25
+ import { URI } from 'vscode/vscode/vs/base/common/uri';
26
+ import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
27
+ import getServiceOverride$1, { initFile } from '@codingame/monaco-vscode-files-service-override';
28
+ import { onRenderWorkbench } from 'vscode/lifecycle';
29
+ import '@codingame/monaco-vscode-40cada32-7e9c-528a-81fc-766e4da54147-common/vscode/vs/workbench/browser/workbench.contribution';
30
+ import './vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js';
31
+ import './vscode/src/vs/workbench/contrib/preferences/browser/keybindingsEditorContribution.js';
32
+ import './vscode/src/vs/workbench/contrib/commands/common/commands.contribution.js';
33
+ import { getService } from 'vscode/services';
34
+
35
+ const defaultUserKeybindindsFile = URI.from({
36
+ scheme: Schemas.vscodeUserData,
37
+ path: '/User/keybindings.json'
38
+ });
39
+ async function initUserKeybindings(configurationJson, options, file = defaultUserKeybindindsFile) {
40
+ await initFile(file, configurationJson, options);
41
+ }
42
+ async function updateUserKeybindings(keybindingsJson) {
43
+ const userDataProfilesService = await getService(IUserDataProfilesService);
44
+ const fileService = await getService(IFileService);
45
+ await fileService.writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsJson));
46
+ }
47
+ let DynamicWorkbenchKeybindingService = class DynamicWorkbenchKeybindingService extends WorkbenchKeybindingService {
48
+ constructor(shouldUseGlobalKeybindings, contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService) {
49
+ super(contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService);
50
+ this.shouldUseGlobalKeybindings = shouldUseGlobalKeybindings;
51
+ this.keybindingProviders = [];
52
+ }
53
+ registerKeybindingProvider(provider) {
54
+ this.keybindingProviders.push(provider);
55
+ this.updateResolver();
56
+ const store = new DisposableStore();
57
+ store.add(provider.onDidChangeKeybindings(() => {
58
+ this.updateResolver();
59
+ }));
60
+ store.add(toDisposable(() => {
61
+ const idx = this.keybindingProviders.indexOf(provider);
62
+ if (idx >= 0) {
63
+ this.keybindingProviders.splice(idx, 1);
64
+ this.updateResolver();
65
+ }
66
+ }));
67
+ return store;
68
+ }
69
+ _getResolver() {
70
+ return super._getResolver();
71
+ }
72
+ _dispatch(e, target) {
73
+ if (!this.shouldUseGlobalKeybindings()) {
74
+ return false;
75
+ }
76
+ return super._dispatch(e, target);
77
+ }
78
+ getUserKeybindingItems() {
79
+ return [
80
+ ...super.getUserKeybindingItems(),
81
+ ...this.keybindingProviders.flatMap((provider) => provider.provideKeybindings())
82
+ ];
83
+ }
84
+ };
85
+ DynamicWorkbenchKeybindingService = __decorate([
86
+ __param(1, IContextKeyService),
87
+ __param(2, ICommandService),
88
+ __param(3, ITelemetryService),
89
+ __param(4, INotificationService),
90
+ __param(5, IUserDataProfileService),
91
+ __param(6, IHostService),
92
+ __param(7, IExtensionService),
93
+ __param(8, IFileService),
94
+ __param(9, IUriIdentityService),
95
+ __param(10, ILogService),
96
+ __param(11, IKeyboardLayoutService)
97
+ ], DynamicWorkbenchKeybindingService);
98
+ onRenderWorkbench((accessor) => {
99
+ accessor.get(IInstantiationService).createInstance(WorkbenchContextKeysHandler);
100
+ });
101
+ function getServiceOverride({ shouldUseGlobalKeybindings = () => false } = {}) {
102
+ return {
103
+ ...getServiceOverride$1(),
104
+ [IKeybindingService.toString()]: new SyncDescriptor(DynamicWorkbenchKeybindingService, [shouldUseGlobalKeybindings], false),
105
+ [IKeyboardLayoutService.toString()]: new SyncDescriptor(BrowserKeyboardLayoutService, [], true),
106
+ [ICommandService.toString()]: new SyncDescriptor(CommandService, [], true)
107
+ };
108
+ }
109
+
110
+ export { getServiceOverride as default, defaultUserKeybindindsFile, initUserKeybindings, updateUserKeybindings };
package/package.json CHANGED
@@ -1,6 +1,8 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-keybindings-service-override",
3
- "version": "11.1.2",
3
+ "version": "12.0.1",
4
+ "private": false,
5
+ "description": "VSCode public API plugged on the monaco editor - keybindings service-override",
4
6
  "keywords": [],
5
7
  "author": {
6
8
  "name": "CodinGame",
@@ -12,8 +14,18 @@
12
14
  "url": "git+ssh://git@github.com/CodinGame/monaco-vscode-api.git"
13
15
  },
14
16
  "type": "module",
15
- "private": false,
16
- "description": "VSCode public API plugged on the monaco editor - keybindings service-override",
17
+ "dependencies": {
18
+ "@codingame/monaco-vscode-2a22c7b4-b906-5914-8cd1-3ed912fb738f-common": "12.0.1",
19
+ "@codingame/monaco-vscode-40cada32-7e9c-528a-81fc-766e4da54147-common": "12.0.1",
20
+ "@codingame/monaco-vscode-4a36e358-d94d-55e0-86ee-3bcd543d9d3f-common": "12.0.1",
21
+ "@codingame/monaco-vscode-d609a7d3-bf87-551a-884f-550a8b327ec5-common": "12.0.1",
22
+ "@codingame/monaco-vscode-d6e33d82-c101-549d-a885-0807ab3e0cfb-common": "12.0.1",
23
+ "@codingame/monaco-vscode-e571cbbb-526b-5d8b-92c5-a0437d2dabb3-common": "12.0.1",
24
+ "@codingame/monaco-vscode-files-service-override": "12.0.1",
25
+ "vscode": "npm:@codingame/monaco-vscode-api@12.0.1"
26
+ },
27
+ "peerDependencies": {},
28
+ "peerDependenciesMeta": {},
17
29
  "main": "index.js",
18
30
  "module": "index.js",
19
31
  "types": "index.d.ts",
@@ -22,11 +34,12 @@
22
34
  "default": "./index.js"
23
35
  },
24
36
  "./vscode/*": {
25
- "default": "./vscode/src/*.js"
37
+ "default": "./vscode/src/*.js",
38
+ "types": "./vscode/src/*.d.ts"
39
+ },
40
+ "./*": {
41
+ "default": "./*.js",
42
+ "types": "./*.d.ts"
26
43
  }
27
- },
28
- "dependencies": {
29
- "vscode": "npm:@codingame/monaco-vscode-api@11.1.2",
30
- "@codingame/monaco-vscode-files-service-override": "11.1.2"
31
44
  }
32
45
  }
@@ -0,0 +1,10 @@
1
+ import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
2
+ export declare enum DispatchConfig {
3
+ Code = 0,
4
+ KeyCode = 1
5
+ }
6
+ export interface IKeyboardConfig {
7
+ dispatch: DispatchConfig;
8
+ mapAltGrToCtrlAlt: boolean;
9
+ }
10
+ export declare function readKeyboardConfig(configurationService: IConfigurationService): IKeyboardConfig;
@@ -1,41 +1,47 @@
1
+
1
2
  import { localize } from 'vscode/vscode/vs/nls';
2
- import { OS } from 'vscode/vscode/vs/base/common/platform';
3
- import { Extensions } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
3
+ import { OS, OperatingSystem } from 'vscode/vscode/vs/base/common/platform';
4
+ import { Extensions, ConfigurationScope } from 'vscode/vscode/vs/platform/configuration/common/configurationRegistry';
4
5
  import { Registry } from 'vscode/vscode/vs/platform/registry/common/platform';
5
6
 
7
+ var DispatchConfig;
8
+ (function (DispatchConfig) {
9
+ DispatchConfig[DispatchConfig["Code"] = 0] = "Code";
10
+ DispatchConfig[DispatchConfig["KeyCode"] = 1] = "KeyCode";
11
+ })(DispatchConfig || (DispatchConfig = {}));
6
12
  function readKeyboardConfig(configurationService) {
7
13
  const keyboard = configurationService.getValue('keyboard');
8
- const dispatch = ((keyboard?.dispatch === 'keyCode' ? 1 : 0) );
14
+ const dispatch = (keyboard?.dispatch === 'keyCode' ? DispatchConfig.KeyCode : DispatchConfig.Code);
9
15
  const mapAltGrToCtrlAlt = Boolean(keyboard?.mapAltGrToCtrlAlt);
10
16
  return { dispatch, mapAltGrToCtrlAlt };
11
17
  }
12
- const configurationRegistry = ( (Registry.as(Extensions.Configuration)));
18
+ const configurationRegistry = ( Registry.as(Extensions.Configuration));
13
19
  const keyboardConfiguration = {
14
20
  'id': 'keyboard',
15
21
  'order': 15,
16
22
  'type': 'object',
17
- 'title': ( localize(8871, "Keyboard")),
23
+ 'title': ( localize(1784, "Keyboard")),
18
24
  'properties': {
19
25
  'keyboard.dispatch': {
20
- scope: 1 ,
26
+ scope: ConfigurationScope.APPLICATION,
21
27
  type: 'string',
22
28
  enum: ['code', 'keyCode'],
23
29
  default: 'code',
24
30
  markdownDescription: ( localize(
25
- 8872,
31
+ 1785,
26
32
  "Controls the dispatching logic for key presses to use either `code` (recommended) or `keyCode`."
27
33
  )),
28
- included: OS === 2 || OS === 3
34
+ included: OS === OperatingSystem.Macintosh || OS === OperatingSystem.Linux
29
35
  },
30
36
  'keyboard.mapAltGrToCtrlAlt': {
31
- scope: 1 ,
37
+ scope: ConfigurationScope.APPLICATION,
32
38
  type: 'boolean',
33
39
  default: false,
34
- markdownDescription: ( localize(8873, "Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+.")),
35
- included: OS === 1
40
+ markdownDescription: ( localize(1786, "Controls if the AltGraph+ modifier should be treated as Ctrl+Alt+.")),
41
+ included: OS === OperatingSystem.Windows
36
42
  }
37
43
  }
38
44
  };
39
45
  configurationRegistry.registerConfiguration(keyboardConfiguration);
40
46
 
41
- export { readKeyboardConfig };
47
+ export { DispatchConfig, readKeyboardConfig };
@@ -0,0 +1,15 @@
1
+ import { ResolvedKeybinding, Keybinding } from "vscode/vscode/vs/base/common/keybindings";
2
+ import { IKeyboardEvent } from "vscode/vscode/vs/platform/keybinding/common/keybinding";
3
+ export interface IKeyboardMapper {
4
+ dumpDebugInfo(): string;
5
+ resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding;
6
+ resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[];
7
+ }
8
+ export declare class CachedKeyboardMapper implements IKeyboardMapper {
9
+ private _actual;
10
+ private _cache;
11
+ constructor(actual: IKeyboardMapper);
12
+ dumpDebugInfo(): string;
13
+ resolveKeyboardEvent(keyboardEvent: IKeyboardEvent): ResolvedKeybinding;
14
+ resolveKeybinding(keybinding: Keybinding): ResolvedKeybinding[];
15
+ }
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  class CachedKeyboardMapper {
2
4
  constructor(actual) {
3
5
  this._actual = actual;
@@ -0,0 +1,67 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { IContextKeyService } from "vscode/vscode/vs/platform/contextkey/common/contextkey.service";
3
+ import { IEditorGroupsService } from "vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service";
4
+ import { IConfigurationService } from "vscode/vscode/vs/platform/configuration/common/configuration.service";
5
+ import { IWorkbenchEnvironmentService } from "vscode/vscode/vs/workbench/services/environment/common/environmentService.service";
6
+ import { IWorkspaceContextService } from "vscode/vscode/vs/platform/workspace/common/workspace.service";
7
+ import { IWorkbenchLayoutService } from "vscode/vscode/vs/workbench/services/layout/browser/layoutService.service";
8
+ import { IWorkingCopyService } from "vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service";
9
+ import { IPaneCompositePartService } from "vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service";
10
+ import { IProductService } from "vscode/vscode/vs/platform/product/common/productService.service";
11
+ import { IEditorService } from "vscode/vscode/vs/workbench/services/editor/common/editorService.service";
12
+ export declare class WorkbenchContextKeysHandler extends Disposable {
13
+ private readonly contextKeyService;
14
+ private readonly contextService;
15
+ private readonly configurationService;
16
+ private readonly environmentService;
17
+ private readonly productService;
18
+ private readonly editorGroupService;
19
+ private readonly editorService;
20
+ private readonly layoutService;
21
+ private readonly paneCompositeService;
22
+ private readonly workingCopyService;
23
+ private inputFocusedContext;
24
+ private dirtyWorkingCopiesContext;
25
+ private activeEditorGroupEmpty;
26
+ private activeEditorGroupIndex;
27
+ private activeEditorGroupLast;
28
+ private activeEditorGroupLocked;
29
+ private multipleEditorGroupsContext;
30
+ private editorsVisibleContext;
31
+ private splitEditorsVerticallyContext;
32
+ private workbenchStateContext;
33
+ private workspaceFolderCountContext;
34
+ private openFolderWorkspaceSupportContext;
35
+ private enterMultiRootWorkspaceSupportContext;
36
+ private emptyWorkspaceSupportContext;
37
+ private virtualWorkspaceContext;
38
+ private temporaryWorkspaceContext;
39
+ private inZenModeContext;
40
+ private isMainWindowFullscreenContext;
41
+ private isAuxiliaryWindowFocusedContext;
42
+ private isMainEditorCenteredLayoutContext;
43
+ private sideBarVisibleContext;
44
+ private mainEditorAreaVisibleContext;
45
+ private panelPositionContext;
46
+ private panelVisibleContext;
47
+ private panelAlignmentContext;
48
+ private panelMaximizedContext;
49
+ private auxiliaryBarVisibleContext;
50
+ private editorTabsVisibleContext;
51
+ private titleAreaVisibleContext;
52
+ private titleBarStyleContext;
53
+ constructor(contextKeyService: IContextKeyService, contextService: IWorkspaceContextService, configurationService: IConfigurationService, environmentService: IWorkbenchEnvironmentService, productService: IProductService, editorGroupService: IEditorGroupsService, editorService: IEditorService, layoutService: IWorkbenchLayoutService, paneCompositeService: IPaneCompositePartService, workingCopyService: IWorkingCopyService);
54
+ private registerListeners;
55
+ private updateVisiblePanesContextKeys;
56
+ private updateActiveEditorGroupContextKeys;
57
+ private updateEditorGroupsContextKeys;
58
+ private updateEditorAreaContextKeys;
59
+ private updateInputContextKeys;
60
+ private updateWorkbenchStateContextKey;
61
+ private updateWorkspaceFolderCountContextKey;
62
+ private updateSplitEditorsVerticallyContext;
63
+ private getWorkbenchStateString;
64
+ private updateSideBarContextKeys;
65
+ private updateTitleBarContextKeys;
66
+ private updateWorkspaceContextKeys;
67
+ }
@@ -1,4 +1,5 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
1
+
2
+ import { __decorate, __param } from 'vscode/external/tslib/tslib.es6';
2
3
  import { Event } from 'vscode/vscode/vs/base/common/event';
3
4
  import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
4
5
  import { setConstant } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
@@ -6,16 +7,16 @@ import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/
6
7
  import { IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsIOSContext, IsMobileContext, IsDevelopmentContext, ProductQualityContext, InputFocusedContext } from 'vscode/vscode/vs/platform/contextkey/common/contextkeys';
7
8
  import { RemoteNameContext, VirtualWorkspaceContext, TemporaryWorkspaceContext, HasWebFileSystemAccess, EmbedderIdentifierContext, ActiveEditorGroupEmptyContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorGroupLockedContext, MultipleEditorGroupsContext, EditorsVisibleContext, DirtyWorkingCopiesContext, WorkbenchStateContext, WorkspaceFolderCountContext, OpenFolderWorkspaceSupportContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, SplitEditorsVertically, IsMainWindowFullscreenContext, IsAuxiliaryWindowFocusedContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, EditorTabsVisibleContext, SideBarVisibleContext, TitleBarVisibleContext, TitleBarStyleContext, PanelPositionContext, PanelVisibleContext, PanelMaximizedContext, PanelAlignmentContext, AuxiliaryBarVisibleContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
8
9
  import { onDidRegisterWindow, addDisposableListener, EventType, isEditableElement, trackFocus, getActiveWindow } from 'vscode/vscode/vs/base/browser/dom';
9
- import { preferredSideBySideGroupDirection } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
10
+ import { preferredSideBySideGroupDirection, GroupDirection } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
10
11
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
11
12
  import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
12
13
  import { IWorkbenchEnvironmentService } from 'vscode/vscode/vs/workbench/services/environment/common/environmentService.service';
13
- import { isTemporaryWorkspace } from 'vscode/vscode/vs/platform/workspace/common/workspace';
14
+ import { WorkbenchState, isTemporaryWorkspace } from 'vscode/vscode/vs/platform/workspace/common/workspace';
14
15
  import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
15
- import { positionToString } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
16
+ import { positionToString, Parts } from '@codingame/monaco-vscode-e571cbbb-526b-5d8b-92c5-a0437d2dabb3-common/vscode/vs/workbench/services/layout/browser/layoutService';
16
17
  import { IWorkbenchLayoutService } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService.service';
17
18
  import { getRemoteName } from 'vscode/vscode/vs/platform/remote/common/remoteHosts';
18
- import { getVirtualWorkspaceScheme } from 'vscode/vscode/vs/platform/workspace/common/virtualWorkspace';
19
+ import { getVirtualWorkspaceScheme } from '@codingame/monaco-vscode-d6e33d82-c101-549d-a885-0807ab3e0cfb-common/vscode/vs/platform/workspace/common/virtualWorkspace';
19
20
  import { IWorkingCopyService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyService.service';
20
21
  import { isNative } from 'vscode/vscode/vs/base/common/platform';
21
22
  import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
@@ -90,13 +91,13 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
90
91
  this.panelPositionContext = PanelPositionContext.bindTo(this.contextKeyService);
91
92
  this.panelPositionContext.set(positionToString(this.layoutService.getPanelPosition()));
92
93
  this.panelVisibleContext = PanelVisibleContext.bindTo(this.contextKeyService);
93
- this.panelVisibleContext.set(this.layoutService.isVisible("workbench.parts.panel" ));
94
+ this.panelVisibleContext.set(this.layoutService.isVisible(Parts.PANEL_PART));
94
95
  this.panelMaximizedContext = PanelMaximizedContext.bindTo(this.contextKeyService);
95
96
  this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
96
97
  this.panelAlignmentContext = PanelAlignmentContext.bindTo(this.contextKeyService);
97
98
  this.panelAlignmentContext.set(this.layoutService.getPanelAlignment());
98
99
  this.auxiliaryBarVisibleContext = AuxiliaryBarVisibleContext.bindTo(this.contextKeyService);
99
- this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.auxiliarybar" ));
100
+ this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
100
101
  this.registerListeners();
101
102
  }
102
103
  registerListeners() {
@@ -136,10 +137,10 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
136
137
  this._register(this.paneCompositeService.onDidPaneCompositeClose(() => this.updateSideBarContextKeys()));
137
138
  this._register(this.paneCompositeService.onDidPaneCompositeOpen(() => this.updateSideBarContextKeys()));
138
139
  this._register(this.layoutService.onDidChangePartVisibility(() => {
139
- this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible("workbench.parts.editor" , mainWindow));
140
- this.panelVisibleContext.set(this.layoutService.isVisible("workbench.parts.panel" ));
140
+ this.mainEditorAreaVisibleContext.set(this.layoutService.isVisible(Parts.EDITOR_PART, mainWindow));
141
+ this.panelVisibleContext.set(this.layoutService.isVisible(Parts.PANEL_PART));
141
142
  this.panelMaximizedContext.set(this.layoutService.isPanelMaximized());
142
- this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.auxiliarybar" ));
143
+ this.auxiliaryBarVisibleContext.set(this.layoutService.isVisible(Parts.AUXILIARYBAR_PART));
143
144
  this.updateTitleBarContextKeys();
144
145
  }));
145
146
  this._register(this.workingCopyService.onDidChangeDirty(workingCopy => this.dirtyWorkingCopiesContext.set(workingCopy.isDirty() || this.workingCopyService.hasDirty)));
@@ -203,20 +204,20 @@ let WorkbenchContextKeysHandler = class WorkbenchContextKeysHandler extends Disp
203
204
  }
204
205
  updateSplitEditorsVerticallyContext() {
205
206
  const direction = preferredSideBySideGroupDirection(this.configurationService);
206
- this.splitEditorsVerticallyContext.set(direction === 1 );
207
+ this.splitEditorsVerticallyContext.set(direction === GroupDirection.DOWN);
207
208
  }
208
209
  getWorkbenchStateString() {
209
210
  switch (this.contextService.getWorkbenchState()) {
210
- case 1 : return 'empty';
211
- case 2 : return 'folder';
212
- case 3 : return 'workspace';
211
+ case WorkbenchState.EMPTY: return 'empty';
212
+ case WorkbenchState.FOLDER: return 'folder';
213
+ case WorkbenchState.WORKSPACE: return 'workspace';
213
214
  }
214
215
  }
215
216
  updateSideBarContextKeys() {
216
- this.sideBarVisibleContext.set(this.layoutService.isVisible("workbench.parts.sidebar" ));
217
+ this.sideBarVisibleContext.set(this.layoutService.isVisible(Parts.SIDEBAR_PART));
217
218
  }
218
219
  updateTitleBarContextKeys() {
219
- this.titleAreaVisibleContext.set(this.layoutService.isVisible("workbench.parts.titlebar" , mainWindow));
220
+ this.titleAreaVisibleContext.set(this.layoutService.isVisible(Parts.TITLEBAR_PART, mainWindow));
220
221
  this.titleBarStyleContext.set(getTitleBarStyle(this.configurationService));
221
222
  }
222
223
  updateWorkspaceContextKeys() {
@@ -1,3 +1,4 @@
1
+
1
2
  import { safeStringify } from 'vscode/vscode/vs/base/common/objects';
2
3
  import { localize2, localize } from 'vscode/vscode/vs/nls';
3
4
  import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
@@ -9,10 +10,10 @@ class RunCommands extends Action2 {
9
10
  constructor() {
10
11
  super({
11
12
  id: 'runCommands',
12
- title: ( localize2(3562, "Run Commands")),
13
+ title: ( localize2(4786, "Run Commands")),
13
14
  f1: false,
14
15
  metadata: {
15
- description: ( localize(3563, "Run several commands")),
16
+ description: ( localize(4787, "Run several commands")),
16
17
  args: [
17
18
  {
18
19
  name: 'args',
@@ -22,7 +23,7 @@ class RunCommands extends Action2 {
22
23
  properties: {
23
24
  commands: {
24
25
  type: 'array',
25
- description: ( localize(3564, "Commands to run")),
26
+ description: ( localize(4788, "Commands to run")),
26
27
  items: {
27
28
  anyOf: [
28
29
  {
@@ -62,14 +63,14 @@ class RunCommands extends Action2 {
62
63
  const notificationService = accessor.get(INotificationService);
63
64
  if (!this._isCommandArgs(args)) {
64
65
  notificationService.error(( localize(
65
- 3565,
66
+ 4789,
66
67
  "'runCommands' has received an argument with incorrect type. Please, review the argument passed to the command."
67
68
  )));
68
69
  return;
69
70
  }
70
71
  if (args.commands.length === 0) {
71
72
  notificationService.warn(( localize(
72
- 3566,
73
+ 4790,
73
74
  "'runCommands' has not received commands to run. Did you forget to pass commands in the 'runCommands' argument?"
74
75
  )));
75
76
  return;
@@ -1,3 +1,4 @@
1
+
1
2
  import { localize2 } from 'vscode/vscode/vs/nls';
2
3
  import { Action2, registerAction2 } from 'vscode/vscode/vs/platform/actions/common/actions';
3
4
  import { IKeybindingService } from 'vscode/vscode/vs/platform/keybinding/common/keybinding.service';
@@ -9,7 +10,7 @@ class ToggleKeybindingsLogAction extends Action2 {
9
10
  constructor() {
10
11
  super({
11
12
  id: 'workbench.action.toggleKeybindingsLog',
12
- title: ( localize2(3558, "Toggle Keyboard Shortcuts Troubleshooting")),
13
+ title: ( localize2(6931, "Toggle Keyboard Shortcuts Troubleshooting")),
13
14
  category: Categories.Developer,
14
15
  f1: true
15
16
  });
@@ -0,0 +1,14 @@
1
+ import { Disposable } from "vscode/vscode/vs/base/common/lifecycle";
2
+ import { IKeybindingService } from "vscode/vscode/vs/platform/keybinding/common/keybinding.service";
3
+ import { ICodeEditor } from "vscode/vscode/vs/editor/browser/editorBrowser";
4
+ export declare class KeybindingEditorDecorationsRenderer extends Disposable {
5
+ private _editor;
6
+ private readonly _keybindingService;
7
+ private _updateDecorations;
8
+ private readonly _dec;
9
+ constructor(_editor: ICodeEditor, _keybindingService: IKeybindingService);
10
+ private _updateDecorationsNow;
11
+ private _getDecorationForEntry;
12
+ static _userSettingsFuzzyEquals(a: string, b: string): boolean;
13
+ private _createDecoration;
14
+ }