@codingame/monaco-vscode-keybindings-service-override 1.83.11 → 1.83.13
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/keybindings.js +0 -1
- package/package.json +3 -3
- package/monaco.js +0 -231
- package/tools/injection.js +0 -17
package/keybindings.js
CHANGED
|
@@ -24,7 +24,6 @@ import { Schemas } from 'monaco-editor/esm/vs/base/common/network.js';
|
|
|
24
24
|
import { URI } from 'monaco-editor/esm/vs/base/common/uri.js';
|
|
25
25
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
26
26
|
import getServiceOverride$1, { initFile } from '@codingame/monaco-vscode-files-service-override';
|
|
27
|
-
import './monaco.js';
|
|
28
27
|
import { onRenderWorkbench } from 'vscode/lifecycle';
|
|
29
28
|
import 'vscode/vscode/vs/workbench/browser/workbench.contribution';
|
|
30
29
|
import './vscode/src/vs/workbench/contrib/keybindings/browser/keybindings.contribution.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-keybindings-service-override",
|
|
3
|
-
"version": "1.83.
|
|
3
|
+
"version": "1.83.13",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.83.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.83.13",
|
|
22
22
|
"monaco-editor": "0.44.0",
|
|
23
|
-
"@codingame/monaco-vscode-files-service-override": "1.83.
|
|
23
|
+
"@codingame/monaco-vscode-files-service-override": "1.83.13"
|
|
24
24
|
}
|
|
25
25
|
}
|
package/monaco.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { __decorate, __param } from './external/tslib/tslib.es6.js';
|
|
2
|
-
import { StandaloneKeybindingService } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|
|
3
|
-
import { ITextResourceConfigurationService } from 'monaco-editor/esm/vs/editor/common/services/textResourceConfiguration.js';
|
|
4
|
-
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
5
|
-
import { StandaloneEditor, StandaloneDiffEditor2 } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
|
|
6
|
-
import { isObject } from 'monaco-editor/esm/vs/base/common/types.js';
|
|
7
|
-
import { distinct, deepClone } from 'monaco-editor/esm/vs/base/common/objects.js';
|
|
8
|
-
export { errorHandler } from 'monaco-editor/esm/vs/base/common/errors.js';
|
|
9
|
-
export { FoldingModel, setCollapseStateForMatchingLines } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/foldingModel.js';
|
|
10
|
-
export { FoldingController } from 'monaco-editor/esm/vs/editor/contrib/folding/browser/folding.js';
|
|
11
|
-
export { DisposableStore } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
|
|
12
|
-
import { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
13
|
-
export { Registry } from 'monaco-editor/esm/vs/platform/registry/common/platform.js';
|
|
14
|
-
import { Extensions as Extensions$1 } from 'monaco-editor/esm/vs/platform/jsonschemas/common/jsonContributionRegistry.js';
|
|
15
|
-
import { ICommandService } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
16
|
-
export { CommandsRegistry } from 'monaco-editor/esm/vs/platform/commands/common/commands.js';
|
|
17
|
-
export { MenuId, MenuRegistry } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
18
|
-
export { KeybindingsRegistry } from 'monaco-editor/esm/vs/platform/keybinding/common/keybindingsRegistry.js';
|
|
19
|
-
import { Extensions as Extensions$2 } from 'monaco-editor/esm/vs/platform/configuration/common/configurationRegistry.js';
|
|
20
|
-
import { EditorOptionsUtil } from 'vscode/vscode/vs/editor/browser/config/editorConfiguration';
|
|
21
|
-
export { registerColor } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
22
|
-
import 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
|
|
23
|
-
import 'monaco-editor/esm/vs/platform/files/common/files.js';
|
|
24
|
-
import 'monaco-editor/esm/vs/base/common/buffer.js';
|
|
25
|
-
import { JSONValidationExtensionPoint } from 'vscode/vscode/vs/workbench/api/common/jsonValidationExtensionPoint';
|
|
26
|
-
import { Extensions } from 'vscode/vscode/vs/workbench/common/contributions';
|
|
27
|
-
import { ColorExtensionPoint } from 'vscode/vscode/vs/workbench/services/themes/common/colorExtensionPoint';
|
|
28
|
-
import 'monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js';
|
|
29
|
-
import 'monaco-editor/esm/vs/platform/quickinput/common/quickInput.js';
|
|
30
|
-
import 'monaco-editor/esm/vs/editor/standalone/browser/quickInput/standaloneQuickInputService.js';
|
|
31
|
-
import 'monaco-editor/esm/vs/platform/instantiation/common/descriptors.js';
|
|
32
|
-
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
33
|
-
export { ContextKeyExpr, RawContextKey } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
34
|
-
import { ITelemetryService } from 'monaco-editor/esm/vs/platform/telemetry/common/telemetry.js';
|
|
35
|
-
import { INotificationService } from 'monaco-editor/esm/vs/platform/notification/common/notification.js';
|
|
36
|
-
import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
37
|
-
import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
|
|
38
|
-
import 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
39
|
-
import { Emitter } from 'monaco-editor';
|
|
40
|
-
import { createInjectedClass } from './tools/injection.js';
|
|
41
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/workbenchReferenceSearch';
|
|
42
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/menuPreventer';
|
|
43
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/diffEditorHelper';
|
|
44
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/largeFileOptimizations';
|
|
45
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/inspectEditorTokens/inspectEditorTokens';
|
|
46
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/saveParticipants';
|
|
47
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/toggleMinimap';
|
|
48
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/toggleMultiCursorModifier';
|
|
49
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter';
|
|
50
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/toggleWordWrap';
|
|
51
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace';
|
|
52
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu';
|
|
53
|
-
import 'vscode/vscode/vs/workbench/contrib/folding/browser/folding.contribution';
|
|
54
|
-
import 'vscode/vscode/vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty';
|
|
55
|
-
import 'vscode/vscode/vs/workbench/contrib/codeActions/browser/codeActions.contribution';
|
|
56
|
-
import 'vscode/vscode/vs/workbench/contrib/list/browser/list.contribution';
|
|
57
|
-
import 'vscode/vscode/vs/workbench/contrib/codeEditor/browser/editorFeatures';
|
|
58
|
-
|
|
59
|
-
let ExtensionPoints = class ExtensionPoints {
|
|
60
|
-
constructor(instantiationService) {
|
|
61
|
-
this.instantiationService = instantiationService;
|
|
62
|
-
this.instantiationService.createInstance(JSONValidationExtensionPoint);
|
|
63
|
-
this.instantiationService.createInstance(ColorExtensionPoint);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
ExtensionPoints = __decorate([
|
|
67
|
-
( __param(0, IInstantiationService))
|
|
68
|
-
], ExtensionPoints);
|
|
69
|
-
( Registry.as(Extensions.Workbench)).registerWorkbenchContribution(ExtensionPoints, 1 );
|
|
70
|
-
function computeConfiguration(configuration, overrides) {
|
|
71
|
-
const editorConfiguration = isObject(configuration.editor) ? deepClone(configuration.editor) : Object.create(null);
|
|
72
|
-
Object.assign(editorConfiguration, deepClone(overrides));
|
|
73
|
-
return editorConfiguration;
|
|
74
|
-
}
|
|
75
|
-
function computeDiffConfiguration(configuration, overrides) {
|
|
76
|
-
const editorConfiguration = computeConfiguration(configuration);
|
|
77
|
-
if (isObject(configuration.diffEditor)) {
|
|
78
|
-
const diffEditorConfiguration = deepClone(configuration.diffEditor);
|
|
79
|
-
diffEditorConfiguration.diffCodeLens = diffEditorConfiguration.codeLens;
|
|
80
|
-
delete diffEditorConfiguration.codeLens;
|
|
81
|
-
diffEditorConfiguration.diffWordWrap = diffEditorConfiguration.wordWrap;
|
|
82
|
-
delete diffEditorConfiguration.wordWrap;
|
|
83
|
-
Object.assign(editorConfiguration, diffEditorConfiguration);
|
|
84
|
-
}
|
|
85
|
-
editorConfiguration.accessibilityVerbose = configuration.accessibility?.verbosity?.diffEditor ?? false;
|
|
86
|
-
Object.assign(editorConfiguration, deepClone(overrides));
|
|
87
|
-
return editorConfiguration;
|
|
88
|
-
}
|
|
89
|
-
let ConfiguredStandaloneEditor = class ConfiguredStandaloneEditor extends createInjectedClass(StandaloneEditor) {
|
|
90
|
-
constructor(domElement, _options = {}, instantiationService, textResourceConfigurationService) {
|
|
91
|
-
const { theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement, overflowWidgetsDomNode, dimension, ...options } = _options;
|
|
92
|
-
const computedOptions = computeConfiguration(textResourceConfigurationService.getValue(_options.model?.uri), options);
|
|
93
|
-
super(instantiationService, domElement, { ...computedOptions, overflowWidgetsDomNode, dimension, theme, autoDetectHighContrast, model, value, language, accessibilityHelpUrl, ariaContainerElement });
|
|
94
|
-
this.textResourceConfigurationService = textResourceConfigurationService;
|
|
95
|
-
this.optionsOverrides = {};
|
|
96
|
-
this.lastAppliedEditorOptions = computedOptions;
|
|
97
|
-
this.optionsOverrides = options;
|
|
98
|
-
this._register(textResourceConfigurationService.onDidChangeConfiguration((e) => {
|
|
99
|
-
const resource = this.getModel()?.uri;
|
|
100
|
-
if (resource != null && e.affectsConfiguration(resource, 'editor')) {
|
|
101
|
-
this.updateEditorConfiguration();
|
|
102
|
-
}
|
|
103
|
-
}));
|
|
104
|
-
this._register(this.onDidChangeModelLanguage(() => this.updateEditorConfiguration()));
|
|
105
|
-
this._register(this.onDidChangeModel(() => this.updateEditorConfiguration()));
|
|
106
|
-
this.updateEditorConfiguration();
|
|
107
|
-
}
|
|
108
|
-
updateEditorConfiguration() {
|
|
109
|
-
if (!this.hasModel() || this.textResourceConfigurationService == null) {
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
const resource = this.getModel().uri;
|
|
113
|
-
const configuration = this.textResourceConfigurationService.getValue(resource);
|
|
114
|
-
if (configuration == null) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
const editorConfiguration = computeConfiguration(configuration, this.optionsOverrides);
|
|
118
|
-
let editorSettingsToApply = editorConfiguration;
|
|
119
|
-
if (this.lastAppliedEditorOptions != null) {
|
|
120
|
-
editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
|
|
121
|
-
}
|
|
122
|
-
if (( Object.keys(editorSettingsToApply)).length > 0) {
|
|
123
|
-
this.lastAppliedEditorOptions = editorConfiguration;
|
|
124
|
-
super.updateOptions(editorSettingsToApply);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
updateOptions(newOptions) {
|
|
128
|
-
this.optionsOverrides ?? (this.optionsOverrides = {});
|
|
129
|
-
const didChange = EditorOptionsUtil.applyUpdate(this.optionsOverrides, newOptions);
|
|
130
|
-
if (!didChange) {
|
|
131
|
-
return;
|
|
132
|
-
}
|
|
133
|
-
this.updateEditorConfiguration();
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
ConfiguredStandaloneEditor = __decorate([
|
|
137
|
-
( __param(2, IInstantiationService)),
|
|
138
|
-
( __param(3, ITextResourceConfigurationService))
|
|
139
|
-
], ConfiguredStandaloneEditor);
|
|
140
|
-
let ConfiguredStandaloneDiffEditor = class ConfiguredStandaloneDiffEditor extends createInjectedClass(StandaloneDiffEditor2) {
|
|
141
|
-
constructor(domElement, _options = {}, instantiationService, textResourceConfigurationService) {
|
|
142
|
-
const { theme, autoDetectHighContrast, modifiedAriaLabel, originalAriaLabel, overflowWidgetsDomNode, dimension, ...options } = _options;
|
|
143
|
-
const computedOptions = computeDiffConfiguration(textResourceConfigurationService.getValue(undefined), options);
|
|
144
|
-
super(instantiationService, domElement, { ...computedOptions, overflowWidgetsDomNode, dimension, theme, autoDetectHighContrast, modifiedAriaLabel, originalAriaLabel });
|
|
145
|
-
this.textResourceConfigurationService = textResourceConfigurationService;
|
|
146
|
-
this.optionsOverrides = {};
|
|
147
|
-
this.lastAppliedEditorOptions = computedOptions;
|
|
148
|
-
this.optionsOverrides = options;
|
|
149
|
-
this._register(textResourceConfigurationService.onDidChangeConfiguration((e) => {
|
|
150
|
-
const resource = this._targetEditor.getModel()?.uri;
|
|
151
|
-
if (resource != null && (e.affectsConfiguration(resource, 'editor') || e.affectsConfiguration(resource, 'diffEditor') || e.affectsConfiguration(resource, 'accessibility.verbosity.diffEditor'))) {
|
|
152
|
-
this.updateEditorConfiguration();
|
|
153
|
-
}
|
|
154
|
-
}));
|
|
155
|
-
this._register(this._targetEditor.onDidChangeModelLanguage(() => this.updateEditorConfiguration()));
|
|
156
|
-
this._register(this.onDidChangeModel(() => this.updateEditorConfiguration()));
|
|
157
|
-
this.updateEditorConfiguration();
|
|
158
|
-
}
|
|
159
|
-
updateEditorConfiguration() {
|
|
160
|
-
if (this.getModel() == null || this.textResourceConfigurationService == null) {
|
|
161
|
-
return;
|
|
162
|
-
}
|
|
163
|
-
const resource = this._targetEditor.getModel()?.uri;
|
|
164
|
-
const configuration = this.textResourceConfigurationService.getValue(resource);
|
|
165
|
-
if (configuration == null) {
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const editorConfiguration = computeDiffConfiguration(configuration, this.optionsOverrides);
|
|
169
|
-
let editorSettingsToApply = editorConfiguration;
|
|
170
|
-
if (this.lastAppliedEditorOptions != null) {
|
|
171
|
-
editorSettingsToApply = distinct(this.lastAppliedEditorOptions, editorSettingsToApply);
|
|
172
|
-
}
|
|
173
|
-
if (( Object.keys(editorSettingsToApply)).length > 0) {
|
|
174
|
-
this.lastAppliedEditorOptions = editorConfiguration;
|
|
175
|
-
super.updateOptions(editorSettingsToApply);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
updateOptions(newOptions) {
|
|
179
|
-
this.optionsOverrides ?? (this.optionsOverrides = {});
|
|
180
|
-
this.optionsOverrides = {
|
|
181
|
-
...this.optionsOverrides,
|
|
182
|
-
...newOptions
|
|
183
|
-
};
|
|
184
|
-
this.updateEditorConfiguration();
|
|
185
|
-
}
|
|
186
|
-
_createInnerEditor(instantiationService, container, options) {
|
|
187
|
-
return instantiationService.createInstance(ConfiguredStandaloneEditor, container, options);
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
ConfiguredStandaloneDiffEditor = __decorate([
|
|
191
|
-
( __param(2, IInstantiationService)),
|
|
192
|
-
( __param(3, ITextResourceConfigurationService))
|
|
193
|
-
], ConfiguredStandaloneDiffEditor);
|
|
194
|
-
let DelegateStandaloneKeybindingService = class DelegateStandaloneKeybindingService extends StandaloneKeybindingService {
|
|
195
|
-
constructor(delegate, contextKeyService, commandService, telemetryService, notificationService, logService, codeEditorService) {
|
|
196
|
-
super(contextKeyService, commandService, telemetryService, notificationService, logService, codeEditorService);
|
|
197
|
-
this.delegate = delegate;
|
|
198
|
-
this._onDidChangeKeybindings = new Emitter();
|
|
199
|
-
this._register(delegate.registerKeybindingProvider({
|
|
200
|
-
provideKeybindings: () => {
|
|
201
|
-
return this.getUserKeybindingItems();
|
|
202
|
-
},
|
|
203
|
-
onDidChangeKeybindings: this._onDidChangeKeybindings.event
|
|
204
|
-
}));
|
|
205
|
-
}
|
|
206
|
-
_getResolver() {
|
|
207
|
-
return this.delegate._getResolver();
|
|
208
|
-
}
|
|
209
|
-
updateResolver() {
|
|
210
|
-
super.updateResolver();
|
|
211
|
-
this._onDidChangeKeybindings.fire();
|
|
212
|
-
}
|
|
213
|
-
resolveKeyboardEvent(keyboardEvent) {
|
|
214
|
-
return this.delegate.resolveKeyboardEvent(keyboardEvent);
|
|
215
|
-
}
|
|
216
|
-
resolveKeybinding(keybinding) {
|
|
217
|
-
return this.delegate.resolveKeybinding(keybinding);
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
DelegateStandaloneKeybindingService = __decorate([
|
|
221
|
-
( __param(1, IContextKeyService)),
|
|
222
|
-
( __param(2, ICommandService)),
|
|
223
|
-
( __param(3, ITelemetryService)),
|
|
224
|
-
( __param(4, INotificationService)),
|
|
225
|
-
( __param(5, ILogService)),
|
|
226
|
-
( __param(6, ICodeEditorService))
|
|
227
|
-
], DelegateStandaloneKeybindingService);
|
|
228
|
-
({
|
|
229
|
-
...Extensions$1,
|
|
230
|
-
...Extensions$2
|
|
231
|
-
});
|
package/tools/injection.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { _util } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
2
|
-
|
|
3
|
-
function getInjectedParameters(instantiationService, ctor) {
|
|
4
|
-
return instantiationService.invokeFunction((accessor) => {
|
|
5
|
-
return ( _util.getServiceDependencies(ctor).sort((a, b) => a.index - b.index).map(d => accessor.get(d.id)));
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
function createInjectedClass(ctor) {
|
|
9
|
-
const _ctor = ctor;
|
|
10
|
-
return class extends _ctor {
|
|
11
|
-
constructor(...args) {
|
|
12
|
-
super(...args.slice(1), ...getInjectedParameters(args[0], ctor));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { createInjectedClass };
|