@codingame/monaco-vscode-api 1.81.8-next.2 → 1.81.8-next.3
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/extensions.d.ts +1 -0
- package/extensions.js +3 -0
- package/monaco.js +3 -0
- package/package.json +1 -1
- package/service-override/keybindings.d.ts +4 -1
- package/service-override/keybindings.js +35 -6
- package/service-override/views.js +4 -0
package/extensions.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ interface RegisterRemoteExtensionParams extends RegisterExtensionParams {
|
|
|
17
17
|
interface RegisterExtensionResult {
|
|
18
18
|
id: string;
|
|
19
19
|
dispose(): Promise<void>;
|
|
20
|
+
whenReady(): Promise<void>;
|
|
20
21
|
}
|
|
21
22
|
interface RegisterRemoteExtensionResult extends RegisterExtensionResult {
|
|
22
23
|
}
|
package/extensions.js
CHANGED
|
@@ -82,6 +82,9 @@ function registerExtension(manifest, extHostKind, { defaultNLS, builtin = manife
|
|
|
82
82
|
})();
|
|
83
83
|
let api = {
|
|
84
84
|
id,
|
|
85
|
+
async whenReady() {
|
|
86
|
+
await addExtensionPromise;
|
|
87
|
+
},
|
|
85
88
|
async dispose() {
|
|
86
89
|
const extension = await addExtensionPromise;
|
|
87
90
|
await deltaExtensions([], [extension]);
|
package/monaco.js
CHANGED
|
@@ -148,6 +148,9 @@ let DelegateStandaloneKeybindingService = class DelegateStandaloneKeybindingServ
|
|
|
148
148
|
_getResolver() {
|
|
149
149
|
return this.delegate._getResolver();
|
|
150
150
|
}
|
|
151
|
+
resolveKeyboardEvent(keyboardEvent) {
|
|
152
|
+
return this.delegate.resolveKeyboardEvent(keyboardEvent);
|
|
153
|
+
}
|
|
151
154
|
};
|
|
152
155
|
DelegateStandaloneKeybindingService = __decorate([
|
|
153
156
|
( __param(1, IContextKeyService)),
|
package/package.json
CHANGED
|
@@ -2,6 +2,9 @@ export { IUserFriendlyKeybinding } from '../vscode/src/vs/platform/keybinding/co
|
|
|
2
2
|
import { IEditorOverrideServices } from '../vscode/src/vs/editor/standalone/browser/standaloneServices.js';
|
|
3
3
|
|
|
4
4
|
declare function updateUserKeybindings(keybindingsJson: string): Promise<void>;
|
|
5
|
-
|
|
5
|
+
interface KeybindingsProps {
|
|
6
|
+
shouldUseGlobalKeybindings?: () => boolean;
|
|
7
|
+
}
|
|
8
|
+
declare function getServiceOverride({ shouldUseGlobalKeybindings }?: KeybindingsProps): IEditorOverrideServices;
|
|
6
9
|
|
|
7
10
|
export { getServiceOverride as default, updateUserKeybindings };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { __decorate, __param } from '../external/tslib/tslib.es6.js';
|
|
1
2
|
import '../missing-services.js';
|
|
2
3
|
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
3
4
|
import { SyncDescriptor } from 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
@@ -11,6 +12,14 @@ import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.j
|
|
|
11
12
|
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
12
13
|
import { CommandService } from '../vscode/src/vs/workbench/services/commands/common/commandService.js';
|
|
13
14
|
import { toDisposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
15
|
+
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
16
|
+
import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
|
|
17
|
+
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
18
|
+
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
19
|
+
import { IUserDataProfileService } from '../vscode/src/vs/workbench/services/userDataProfile/common/userDataProfile.js';
|
|
20
|
+
import { IHostService } from '../vscode/src/vs/workbench/services/host/browser/host.js';
|
|
21
|
+
import { IExtensionService } from '../vscode/src/vs/workbench/services/extensions/common/extensions.js';
|
|
22
|
+
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
14
23
|
import getServiceOverride$1 from './files.js';
|
|
15
24
|
import '../vscode/src/vs/workbench/browser/workbench.contribution.js';
|
|
16
25
|
import '../vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js';
|
|
@@ -18,9 +27,10 @@ async function updateUserKeybindings(keybindingsJson) {
|
|
|
18
27
|
const userDataProfilesService = StandaloneServices.get(IUserDataProfilesService);
|
|
19
28
|
await StandaloneServices.get(IFileService).writeFile(userDataProfilesService.defaultProfile.keybindingsResource, VSBuffer.fromString(keybindingsJson));
|
|
20
29
|
}
|
|
21
|
-
class DynamicWorkbenchKeybindingService extends WorkbenchKeybindingService {
|
|
22
|
-
constructor() {
|
|
23
|
-
super(
|
|
30
|
+
let DynamicWorkbenchKeybindingService = class DynamicWorkbenchKeybindingService extends WorkbenchKeybindingService {
|
|
31
|
+
constructor(shouldUseGlobalKeybindings, contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService) {
|
|
32
|
+
super(contextKeyService, commandService, telemetryService, notificationService, userDataProfileService, hostService, extensionService, fileService, uriIdentityService, logService, keyboardLayoutService);
|
|
33
|
+
this.shouldUseGlobalKeybindings = shouldUseGlobalKeybindings;
|
|
24
34
|
this.keybindingProviders = [];
|
|
25
35
|
}
|
|
26
36
|
registerKeybindingProvider(provider) {
|
|
@@ -37,14 +47,33 @@ class DynamicWorkbenchKeybindingService extends WorkbenchKeybindingService {
|
|
|
37
47
|
_getResolver() {
|
|
38
48
|
return super._getResolver();
|
|
39
49
|
}
|
|
50
|
+
_dispatch(e, target) {
|
|
51
|
+
if (!this.shouldUseGlobalKeybindings()) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return super._dispatch(e, target);
|
|
55
|
+
}
|
|
40
56
|
getUserKeybindingItems() {
|
|
41
57
|
return [...super.getUserKeybindingItems(), ...this.keybindingProviders.flatMap(provider => provider())];
|
|
42
58
|
}
|
|
43
|
-
}
|
|
44
|
-
|
|
59
|
+
};
|
|
60
|
+
DynamicWorkbenchKeybindingService = __decorate([
|
|
61
|
+
( __param(1, IContextKeyService)),
|
|
62
|
+
( __param(2, ICommandService)),
|
|
63
|
+
( __param(3, ITelemetryService)),
|
|
64
|
+
( __param(4, INotificationService)),
|
|
65
|
+
( __param(5, IUserDataProfileService)),
|
|
66
|
+
( __param(6, IHostService)),
|
|
67
|
+
( __param(7, IExtensionService)),
|
|
68
|
+
( __param(8, IFileService)),
|
|
69
|
+
( __param(9, IUriIdentityService)),
|
|
70
|
+
( __param(10, ILogService)),
|
|
71
|
+
( __param(11, IKeyboardLayoutService))
|
|
72
|
+
], DynamicWorkbenchKeybindingService);
|
|
73
|
+
function getServiceOverride({ shouldUseGlobalKeybindings = () => false } = {}) {
|
|
45
74
|
return {
|
|
46
75
|
...getServiceOverride$1(),
|
|
47
|
-
[( IKeybindingService.toString())]: new SyncDescriptor(DynamicWorkbenchKeybindingService, [], false),
|
|
76
|
+
[( IKeybindingService.toString())]: new SyncDescriptor(DynamicWorkbenchKeybindingService, [shouldUseGlobalKeybindings], false),
|
|
48
77
|
[( IKeyboardLayoutService.toString())]: new SyncDescriptor(BrowserKeyboardLayoutService, undefined, true),
|
|
49
78
|
[( ICommandService.toString())]: new SyncDescriptor(CommandService, [], true)
|
|
50
79
|
};
|
|
@@ -89,6 +89,7 @@ import { MonacoEditorService, MonacoDelegateEditorGroupsService } from './tools/
|
|
|
89
89
|
import getServiceOverride$2 from './bulkEdit.js';
|
|
90
90
|
import getServiceOverride$1 from './layout.js';
|
|
91
91
|
import getServiceOverride$3 from './quickaccess.js';
|
|
92
|
+
import getServiceOverride$4 from './keybindings.js';
|
|
92
93
|
import { changeUrlDomain } from './tools/url.js';
|
|
93
94
|
import { registerAssets } from '../assets.js';
|
|
94
95
|
import { registerServiceInitializePostParticipant } from '../lifecycle.js';
|
|
@@ -473,6 +474,9 @@ function getServiceOverride(openEditorFallback, _webviewIframeAlternateDomains)
|
|
|
473
474
|
isKeybindingConfigurationVisible: isEditorPartVisible,
|
|
474
475
|
shouldUseGlobalPicker: isEditorPartVisible
|
|
475
476
|
}),
|
|
477
|
+
...getServiceOverride$4({
|
|
478
|
+
shouldUseGlobalKeybindings: isEditorPartVisible
|
|
479
|
+
}),
|
|
476
480
|
[( IViewsService.toString())]: new SyncDescriptor(ViewsService, [], false),
|
|
477
481
|
[( IViewDescriptorService.toString())]: new SyncDescriptor(ViewDescriptorService, [], true),
|
|
478
482
|
[( IActivityService.toString())]: new SyncDescriptor(ActivityService, [], true),
|