@codingame/monaco-vscode-editor-service-override 1.83.16 → 1.85.0-next.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.
- package/editor.js +65 -1
- package/package.json +3 -3
- package/tools/editor.d.ts +8 -8
- package/tools/editor.js +44 -19
package/editor.js
CHANGED
|
@@ -12,12 +12,14 @@ import { FILE_EDITOR_INPUT_ID } from 'vscode/vscode/vs/workbench/contrib/files/c
|
|
|
12
12
|
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
13
13
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
14
14
|
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
15
|
+
import { DEFAULT_EDITOR_PART_OPTIONS } from 'vscode/vscode/vs/workbench/browser/parts/editor/editor';
|
|
15
16
|
import { MonacoEditorService, MonacoDelegateEditorGroupsService } from './tools/editor.js';
|
|
16
17
|
import { unsupported } from './tools.js';
|
|
17
18
|
import 'vscode/vscode/vs/workbench/browser/parts/editor/editor.contribution';
|
|
18
19
|
|
|
19
20
|
class EmptyEditorGroup {
|
|
20
21
|
constructor() {
|
|
22
|
+
this.createEditorActions = unsupported;
|
|
21
23
|
this.onDidFocus = Event.None;
|
|
22
24
|
this.onDidOpenEditorFail = Event.None;
|
|
23
25
|
this.whenRestored = Promise.resolve();
|
|
@@ -77,6 +79,10 @@ class EmptyEditorGroup {
|
|
|
77
79
|
this.isFirst = unsupported;
|
|
78
80
|
this.isLast = unsupported;
|
|
79
81
|
}
|
|
82
|
+
get groupsView() {
|
|
83
|
+
return unsupported();
|
|
84
|
+
}
|
|
85
|
+
notifyLabelChanged() { }
|
|
80
86
|
get titleHeight() {
|
|
81
87
|
return unsupported();
|
|
82
88
|
}
|
|
@@ -88,8 +94,67 @@ class EmptyEditorGroup {
|
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
const fakeActiveGroup = new EmptyEditorGroup();
|
|
97
|
+
class EmptyEditorPart {
|
|
98
|
+
constructor() {
|
|
99
|
+
this.onDidLayout = Event.None;
|
|
100
|
+
this.onDidScroll = Event.None;
|
|
101
|
+
this.isReady = true;
|
|
102
|
+
this.whenReady = Promise.resolve();
|
|
103
|
+
this.whenRestored = Promise.resolve();
|
|
104
|
+
this.hasRestorableState = false;
|
|
105
|
+
this.centerLayout = unsupported;
|
|
106
|
+
this.isLayoutCentered = unsupported;
|
|
107
|
+
this.enforcePartOptions = unsupported;
|
|
108
|
+
this.onDidChangeActiveGroup = Event.None;
|
|
109
|
+
this.onDidAddGroup = Event.None;
|
|
110
|
+
this.onDidRemoveGroup = Event.None;
|
|
111
|
+
this.onDidMoveGroup = Event.None;
|
|
112
|
+
this.onDidActivateGroup = Event.None;
|
|
113
|
+
this.onDidChangeGroupIndex = Event.None;
|
|
114
|
+
this.onDidChangeGroupLocked = Event.None;
|
|
115
|
+
this.onDidChangeGroupMaximized = Event.None;
|
|
116
|
+
this.activeGroup = fakeActiveGroup;
|
|
117
|
+
this.groups = [fakeActiveGroup];
|
|
118
|
+
this.count = 0;
|
|
119
|
+
this.orientation = 0 ;
|
|
120
|
+
this.getGroups = () => [];
|
|
121
|
+
this.getGroup = () => undefined;
|
|
122
|
+
this.activateGroup = unsupported;
|
|
123
|
+
this.getSize = unsupported;
|
|
124
|
+
this.setSize = unsupported;
|
|
125
|
+
this.arrangeGroups = unsupported;
|
|
126
|
+
this.toggleMaximizeGroup = unsupported;
|
|
127
|
+
this.toggleExpandGroup = unsupported;
|
|
128
|
+
this.applyLayout = unsupported;
|
|
129
|
+
this.getLayout = unsupported;
|
|
130
|
+
this.setGroupOrientation = unsupported;
|
|
131
|
+
this.findGroup = () => undefined;
|
|
132
|
+
this.addGroup = unsupported;
|
|
133
|
+
this.removeGroup = unsupported;
|
|
134
|
+
this.moveGroup = unsupported;
|
|
135
|
+
this.mergeGroup = unsupported;
|
|
136
|
+
this.mergeAllGroups = unsupported;
|
|
137
|
+
this.copyGroup = unsupported;
|
|
138
|
+
this.partOptions = DEFAULT_EDITOR_PART_OPTIONS;
|
|
139
|
+
this.onDidChangeEditorPartOptions = Event.None;
|
|
140
|
+
this.createEditorDropTarget = unsupported;
|
|
141
|
+
}
|
|
142
|
+
get contentDimension() { return unsupported(); }
|
|
143
|
+
get sideGroup() { return unsupported(); }
|
|
144
|
+
}
|
|
91
145
|
class EmptyEditorGroupsService {
|
|
92
146
|
constructor() {
|
|
147
|
+
this.onDidCreateAuxiliaryEditorPart = Event.None;
|
|
148
|
+
this.mainPart = new EmptyEditorPart();
|
|
149
|
+
this.activePart = this.mainPart;
|
|
150
|
+
this.parts = [this.mainPart];
|
|
151
|
+
this.getPart = unsupported;
|
|
152
|
+
this.createAuxiliaryEditorPart = unsupported;
|
|
153
|
+
this.onDidChangeGroupMaximized = Event.None;
|
|
154
|
+
this.toggleMaximizeGroup = unsupported;
|
|
155
|
+
this.toggleExpandGroup = unsupported;
|
|
156
|
+
this.partOptions = DEFAULT_EDITOR_PART_OPTIONS;
|
|
157
|
+
this.createEditorDropTarget = unsupported;
|
|
93
158
|
this._serviceBrand = undefined;
|
|
94
159
|
this.getLayout = unsupported;
|
|
95
160
|
this.onDidChangeActiveGroup = Event.None;
|
|
@@ -126,7 +191,6 @@ class EmptyEditorGroupsService {
|
|
|
126
191
|
this.mergeGroup = unsupported;
|
|
127
192
|
this.mergeAllGroups = unsupported;
|
|
128
193
|
this.copyGroup = unsupported;
|
|
129
|
-
this.partOptions = {};
|
|
130
194
|
this.onDidChangeEditorPartOptions = Event.None;
|
|
131
195
|
this.enforcePartOptions = unsupported;
|
|
132
196
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-editor-service-override",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.85.0-next.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.
|
|
22
|
-
"monaco-editor": "0.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.85.0-next.1",
|
|
22
|
+
"monaco-editor": "0.45.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
package/tools/editor.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { IEditorPane, IUntypedEditorInput, IUntitledTextResourceEditorInput, IResourceDiffEditorInput, ITextDiffEditorPane } from 'vscode/vscode/vs/workbench/common/editor';
|
|
2
|
+
import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
|
|
3
|
+
import { PreferredGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
4
|
+
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
5
|
+
import { IEditorOptions, IResourceEditorInput, ITextResourceEditorInput } from 'vscode/vscode/vs/platform/editor/common/editor';
|
|
2
6
|
import { ICodeEditor, IDiffEditor } from 'vscode/vscode/vs/editor/browser/editorBrowser';
|
|
3
|
-
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
7
|
import { IReference } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
8
|
import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration';
|
|
6
|
-
import {
|
|
9
|
+
import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
7
10
|
import { IFileService } from 'vscode/vscode/vs/platform/files/common/files';
|
|
8
11
|
import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace';
|
|
9
12
|
import { IUriIdentityService } from 'vscode/vscode/vs/platform/uriIdentity/common/uriIdentity';
|
|
10
|
-
import { IResolvedTextEditorModel, ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
11
|
-
import { PreferredGroup } from 'vscode/vscode/vs/workbench/services/editor/common/editorService';
|
|
12
|
-
import { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
|
|
13
13
|
import { IHostService } from 'vscode/vscode/vs/workbench/services/host/browser/host';
|
|
14
|
-
import {
|
|
14
|
+
import { IResolvedTextEditorModel, ITextModelService } from 'vscode/vscode/vs/editor/common/services/resolverService';
|
|
15
|
+
import { EditorService } from 'vscode/vscode/vs/workbench/services/editor/browser/editorService';
|
|
16
|
+
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
|
|
15
17
|
import { IEditorResolverService } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
|
|
16
18
|
import { ITextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService';
|
|
17
|
-
import { IWorkspaceTrustRequestService } from 'vscode/vscode/vs/platform/workspace/common/workspaceTrust';
|
|
18
|
-
import { EditorService } from 'vscode/vscode/vs/workbench/services/editor/browser/editorService';
|
|
19
19
|
|
|
20
20
|
type OpenEditor = (modelRef: IReference<IResolvedTextEditorModel>, options: IEditorOptions | undefined, sideBySide?: boolean) => Promise<ICodeEditor | undefined>;
|
|
21
21
|
declare class MonacoEditorService extends EditorService {
|
package/tools/editor.js
CHANGED
|
@@ -89,7 +89,7 @@ function wrapOpenEditor(textModelService, defaultBehavior, fallbackBahavior) {
|
|
|
89
89
|
}
|
|
90
90
|
let MonacoEditorService = class MonacoEditorService extends EditorService {
|
|
91
91
|
constructor(_openEditorFallback, _isEditorPartVisible, _editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService, textModelService) {
|
|
92
|
-
super(_editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService);
|
|
92
|
+
super(undefined, _editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService);
|
|
93
93
|
this._isEditorPartVisible = _isEditorPartVisible;
|
|
94
94
|
this.openEditor = wrapOpenEditor(textModelService, this.openEditor.bind(this), _openEditorFallback);
|
|
95
95
|
}
|
|
@@ -229,7 +229,7 @@ let StandaloneEditorGroup = StandaloneEditorGroup_1 = class StandaloneEditorGrou
|
|
|
229
229
|
});
|
|
230
230
|
this.pane = new StandaloneEditorPane(editor, editorInput, this);
|
|
231
231
|
this._onDidModelChange.fire({
|
|
232
|
-
kind:
|
|
232
|
+
kind: 4 ,
|
|
233
233
|
editor: editorInput,
|
|
234
234
|
editorIndex: 0
|
|
235
235
|
});
|
|
@@ -242,7 +242,7 @@ let StandaloneEditorGroup = StandaloneEditorGroup_1 = class StandaloneEditorGrou
|
|
|
242
242
|
const pane = this.pane;
|
|
243
243
|
this.pane = undefined;
|
|
244
244
|
this._onDidModelChange.fire({
|
|
245
|
-
kind:
|
|
245
|
+
kind: 5 ,
|
|
246
246
|
editorIndex: 0
|
|
247
247
|
});
|
|
248
248
|
this._onDidActiveEditorChange.fire({
|
|
@@ -279,6 +279,19 @@ let StandaloneEditorGroup = StandaloneEditorGroup_1 = class StandaloneEditorGrou
|
|
|
279
279
|
this.pane = new StandaloneEditorPane(editor, editorInput, this);
|
|
280
280
|
}
|
|
281
281
|
}
|
|
282
|
+
get groupsView() {
|
|
283
|
+
return unsupported();
|
|
284
|
+
}
|
|
285
|
+
notifyLabelChanged() { }
|
|
286
|
+
createEditorActions() {
|
|
287
|
+
return {
|
|
288
|
+
actions: {
|
|
289
|
+
primary: [],
|
|
290
|
+
secondary: []
|
|
291
|
+
},
|
|
292
|
+
onDidChange: Event.None
|
|
293
|
+
};
|
|
294
|
+
}
|
|
282
295
|
get titleHeight() { return unsupported(); }
|
|
283
296
|
setActive(isActive) {
|
|
284
297
|
this.active = isActive;
|
|
@@ -315,6 +328,8 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
315
328
|
this._serviceBrand = undefined;
|
|
316
329
|
this.additionalGroups = [];
|
|
317
330
|
this.activeGroupOverride = undefined;
|
|
331
|
+
this.onDidCreateAuxiliaryEditorPart = this.delegate.onDidCreateAuxiliaryEditorPart;
|
|
332
|
+
this.onDidChangeGroupMaximized = this.delegate.onDidChangeGroupMaximized;
|
|
318
333
|
this._onDidChangeActiveGroup = new Emitter();
|
|
319
334
|
this.onDidChangeActiveGroup = Event.any(this._onDidChangeActiveGroup.event, this.delegate.onDidChangeActiveGroup);
|
|
320
335
|
this._onDidAddGroup = new Emitter();
|
|
@@ -323,8 +338,6 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
323
338
|
this.onDidRemoveGroup = Event.any(this._onDidRemoveGroup.event, this.delegate.onDidRemoveGroup);
|
|
324
339
|
this.onDidMoveGroup = this.delegate.onDidMoveGroup;
|
|
325
340
|
this.onDidActivateGroup = this.delegate.onDidActivateGroup;
|
|
326
|
-
this.onDidLayout = this.delegate.onDidLayout;
|
|
327
|
-
this.onDidScroll = this.delegate.onDidScroll;
|
|
328
341
|
this.onDidChangeGroupIndex = this.delegate.onDidChangeGroupIndex;
|
|
329
342
|
this.onDidChangeGroupLocked = this.delegate.onDidChangeGroupLocked;
|
|
330
343
|
this.getLayout = () => {
|
|
@@ -351,12 +364,6 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
351
364
|
this.applyLayout = (...args) => {
|
|
352
365
|
return this.delegate.applyLayout(...args);
|
|
353
366
|
};
|
|
354
|
-
this.centerLayout = (...args) => {
|
|
355
|
-
return this.delegate.centerLayout(...args);
|
|
356
|
-
};
|
|
357
|
-
this.isLayoutCentered = (...args) => {
|
|
358
|
-
return this.delegate.isLayoutCentered(...args);
|
|
359
|
-
};
|
|
360
367
|
this.setGroupOrientation = (...args) => {
|
|
361
368
|
return this.delegate.setGroupOrientation(...args);
|
|
362
369
|
};
|
|
@@ -381,9 +388,6 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
381
388
|
this.copyGroup = (...args) => {
|
|
382
389
|
return this.delegate.copyGroup(...args);
|
|
383
390
|
};
|
|
384
|
-
this.enforcePartOptions = (...args) => {
|
|
385
|
-
return this.delegate.enforcePartOptions(...args);
|
|
386
|
-
};
|
|
387
391
|
this.onDidChangeEditorPartOptions = this.delegate.onDidChangeEditorPartOptions;
|
|
388
392
|
setTimeout(() => {
|
|
389
393
|
const codeEditorService = StandaloneServices.get(ICodeEditorService);
|
|
@@ -393,8 +397,16 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
393
397
|
this.activeGroupOverride = this.additionalGroups.find(group => group.editor === editor);
|
|
394
398
|
this._onDidChangeActiveGroup.fire(this.activeGroup);
|
|
395
399
|
};
|
|
400
|
+
const onEditorBlurred = () => {
|
|
401
|
+
if (this.activeGroupOverride === this.additionalGroups.find(group => group.editor === editor)) {
|
|
402
|
+
this.activeGroupOverride = undefined;
|
|
403
|
+
this._onDidChangeActiveGroup.fire(this.activeGroup);
|
|
404
|
+
}
|
|
405
|
+
};
|
|
396
406
|
editor.onDidFocusEditorText(onEditorFocused);
|
|
397
407
|
editor.onDidFocusEditorWidget(onEditorFocused);
|
|
408
|
+
editor.onDidBlurEditorText(onEditorBlurred);
|
|
409
|
+
editor.onDidBlurEditorWidget(onEditorBlurred);
|
|
398
410
|
if (editor.hasWidgetFocus()) {
|
|
399
411
|
onEditorFocused();
|
|
400
412
|
}
|
|
@@ -422,20 +434,33 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
422
434
|
codeEditorService.listCodeEditors().forEach(handleCodeEditor);
|
|
423
435
|
});
|
|
424
436
|
}
|
|
437
|
+
get parts() { return this.delegate.parts; }
|
|
438
|
+
createAuxiliaryEditorPart(options) {
|
|
439
|
+
return this.delegate.createAuxiliaryEditorPart(options);
|
|
440
|
+
}
|
|
441
|
+
get mainPart() { return this.delegate.mainPart; }
|
|
442
|
+
get activePart() { return this.delegate.activePart; }
|
|
443
|
+
getPart(container) {
|
|
444
|
+
return this.delegate.getPart(container);
|
|
445
|
+
}
|
|
446
|
+
toggleMaximizeGroup(group) {
|
|
447
|
+
return this.delegate.toggleMaximizeGroup(group);
|
|
448
|
+
}
|
|
449
|
+
toggleExpandGroup(group) {
|
|
450
|
+
return this.delegate.toggleExpandGroup(group);
|
|
451
|
+
}
|
|
452
|
+
createEditorDropTarget(container, delegate) {
|
|
453
|
+
return this.delegate.createEditorDropTarget(container, delegate);
|
|
454
|
+
}
|
|
425
455
|
get groups() {
|
|
426
456
|
return [...this.additionalGroups, ...this.delegate.groups];
|
|
427
457
|
}
|
|
428
458
|
get activeGroup() {
|
|
429
459
|
return this.activeGroupOverride ?? this.delegate.activeGroup;
|
|
430
460
|
}
|
|
431
|
-
get contentDimension() { return this.delegate.contentDimension; }
|
|
432
461
|
get sideGroup() { return this.delegate.sideGroup; }
|
|
433
462
|
get count() { return this.delegate.count + this.additionalGroups.length; }
|
|
434
463
|
get orientation() { return this.delegate.orientation; }
|
|
435
|
-
get isReady() { return this.delegate.isReady; }
|
|
436
|
-
get whenReady() { return this.delegate.whenReady; }
|
|
437
|
-
get whenRestored() { return this.delegate.whenRestored; }
|
|
438
|
-
get hasRestorableState() { return this.delegate.hasRestorableState; }
|
|
439
464
|
get partOptions() { return this.delegate.partOptions; }
|
|
440
465
|
};
|
|
441
466
|
MonacoDelegateEditorGroupsService = __decorate([
|