@codingame/monaco-vscode-editor-service-override 3.2.2 → 4.0.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/editor.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { __decorate, __param } from './external/tslib/tslib.es6.js';
2
- import { StandaloneServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
3
2
  import { Event } from 'vscode/vscode/vs/base/common/event';
4
3
  import { ICodeEditorService } from 'vscode/vscode/vs/editor/browser/services/codeEditorService';
5
4
  import { CodeEditorService } from 'vscode/vscode/vs/workbench/services/editor/browser/codeEditorService';
@@ -8,93 +7,14 @@ import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/d
8
7
  import { ITextEditorService, TextEditorService } from 'vscode/vscode/vs/workbench/services/textfile/common/textEditorService';
9
8
  import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
10
9
  import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
11
- import { IContextKeyService } from 'vscode/vscode/vs/platform/contextkey/common/contextkey';
12
10
  import { DEFAULT_EDITOR_PART_OPTIONS } from 'vscode/vscode/vs/workbench/browser/parts/editor/editor';
13
11
  import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
14
- import { MonacoEditorService, MonacoDelegateEditorGroupsService } from './tools/editor.js';
12
+ import { MonacoEditorService, MonacoDelegateEditorGroupsService, fakeActiveGroup } from './tools/editor.js';
15
13
  import { unsupported } from './tools.js';
16
14
  import 'vscode/vscode/vs/workbench/browser/parts/editor/editor.autosave.contribution';
17
15
  import 'vscode/vscode/vs/workbench/contrib/files/browser/files.fileEditorFactory.contribution';
18
16
  import 'vscode/vscode/vs/workbench/contrib/files/browser/fileCommands.save';
19
17
 
20
- class EmptyEditorGroup {
21
- constructor() {
22
- this.windowId = mainWindow.vscodeWindowId;
23
- this.createEditorActions = unsupported;
24
- this.onDidFocus = Event.None;
25
- this.onDidOpenEditorFail = Event.None;
26
- this.whenRestored = Promise.resolve();
27
- this.disposed = false;
28
- this.setActive = unsupported;
29
- this.notifyIndexChanged = unsupported;
30
- this.relayout = unsupported;
31
- this.dispose = unsupported;
32
- this.toJSON = unsupported;
33
- this.minimumWidth = 0;
34
- this.maximumWidth = Number.POSITIVE_INFINITY;
35
- this.minimumHeight = 0;
36
- this.maximumHeight = Number.POSITIVE_INFINITY;
37
- this.onDidChange = Event.None;
38
- this.layout = unsupported;
39
- this.onDidModelChange = Event.None;
40
- this.onWillDispose = Event.None;
41
- this.onDidActiveEditorChange = Event.None;
42
- this.onWillCloseEditor = Event.None;
43
- this.onDidCloseEditor = Event.None;
44
- this.onWillMoveEditor = Event.None;
45
- this.onWillOpenEditor = Event.None;
46
- this.id = 0;
47
- this.index = 0;
48
- this.label = 'main';
49
- this.ariaLabel = 'main';
50
- this.activeEditorPane = undefined;
51
- this.activeEditor = null;
52
- this.previewEditor = null;
53
- this.count = 0;
54
- this.isEmpty = false;
55
- this.isLocked = false;
56
- this.stickyCount = 0;
57
- this.editors = [];
58
- this.getEditors = () => [];
59
- this.findEditors = () => [];
60
- this.getEditorByIndex = () => undefined;
61
- this.getIndexOfEditor = unsupported;
62
- this.openEditor = unsupported;
63
- this.openEditors = unsupported;
64
- this.isPinned = () => false;
65
- this.isSticky = () => false;
66
- this.isActive = () => false;
67
- this.contains = () => false;
68
- this.moveEditor = unsupported;
69
- this.moveEditors = unsupported;
70
- this.copyEditor = unsupported;
71
- this.copyEditors = unsupported;
72
- this.closeEditor = unsupported;
73
- this.closeEditors = unsupported;
74
- this.closeAllEditors = unsupported;
75
- this.replaceEditors = unsupported;
76
- this.pinEditor = () => { };
77
- this.stickEditor = () => { };
78
- this.unstickEditor = () => { };
79
- this.lock = () => { };
80
- this.isFirst = unsupported;
81
- this.isLast = unsupported;
82
- }
83
- get groupsView() {
84
- return unsupported();
85
- }
86
- notifyLabelChanged() { }
87
- get titleHeight() {
88
- return unsupported();
89
- }
90
- get element() {
91
- return unsupported();
92
- }
93
- get scopedContextKeyService() { return StandaloneServices.get(IContextKeyService); }
94
- focus() {
95
- }
96
- }
97
- const fakeActiveGroup = new EmptyEditorGroup();
98
18
  class EmptyEditorPart {
99
19
  constructor() {
100
20
  this.hasMaximizedGroup = () => false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-editor-service-override",
3
- "version": "3.2.2",
3
+ "version": "4.0.0",
4
4
  "keywords": [],
5
5
  "author": {
6
6
  "name": "CodinGame",
@@ -18,6 +18,6 @@
18
18
  "module": "index.js",
19
19
  "types": "index.d.ts",
20
20
  "dependencies": {
21
- "vscode": "npm:@codingame/monaco-vscode-api@3.2.2"
21
+ "vscode": "npm:@codingame/monaco-vscode-api@4.0.0"
22
22
  }
23
23
  }
package/tools/editor.js CHANGED
@@ -26,6 +26,85 @@ import { mainWindow } from 'vscode/vscode/vs/base/browser/window';
26
26
  import { unsupported } from '../tools.js';
27
27
 
28
28
  var StandaloneEditorGroup_1;
29
+ class EmptyEditorGroup {
30
+ constructor() {
31
+ this.isTransient = () => false;
32
+ this.windowId = mainWindow.vscodeWindowId;
33
+ this.createEditorActions = unsupported;
34
+ this.onDidFocus = Event.None;
35
+ this.onDidOpenEditorFail = Event.None;
36
+ this.whenRestored = Promise.resolve();
37
+ this.disposed = false;
38
+ this.setActive = unsupported;
39
+ this.notifyIndexChanged = unsupported;
40
+ this.relayout = unsupported;
41
+ this.dispose = unsupported;
42
+ this.toJSON = unsupported;
43
+ this.minimumWidth = 0;
44
+ this.maximumWidth = Number.POSITIVE_INFINITY;
45
+ this.minimumHeight = 0;
46
+ this.maximumHeight = Number.POSITIVE_INFINITY;
47
+ this.onDidChange = Event.None;
48
+ this.layout = unsupported;
49
+ this.onDidModelChange = Event.None;
50
+ this.onWillDispose = Event.None;
51
+ this.onDidActiveEditorChange = Event.None;
52
+ this.onWillCloseEditor = Event.None;
53
+ this.onDidCloseEditor = Event.None;
54
+ this.onWillMoveEditor = Event.None;
55
+ this.onWillOpenEditor = Event.None;
56
+ this.id = 0;
57
+ this.index = 0;
58
+ this.label = 'main';
59
+ this.ariaLabel = 'main';
60
+ this.activeEditorPane = undefined;
61
+ this.activeEditor = null;
62
+ this.previewEditor = null;
63
+ this.count = 0;
64
+ this.isEmpty = false;
65
+ this.isLocked = false;
66
+ this.stickyCount = 0;
67
+ this.editors = [];
68
+ this.getEditors = () => [];
69
+ this.findEditors = () => [];
70
+ this.getEditorByIndex = () => undefined;
71
+ this.getIndexOfEditor = unsupported;
72
+ this.openEditor = unsupported;
73
+ this.openEditors = unsupported;
74
+ this.isPinned = () => false;
75
+ this.isSticky = () => false;
76
+ this.isActive = () => false;
77
+ this.contains = () => false;
78
+ this.moveEditor = unsupported;
79
+ this.moveEditors = unsupported;
80
+ this.copyEditor = unsupported;
81
+ this.copyEditors = unsupported;
82
+ this.closeEditor = unsupported;
83
+ this.closeEditors = unsupported;
84
+ this.closeAllEditors = unsupported;
85
+ this.replaceEditors = unsupported;
86
+ this.pinEditor = () => { };
87
+ this.stickEditor = () => { };
88
+ this.unstickEditor = () => { };
89
+ this.lock = () => { };
90
+ this.isFirst = unsupported;
91
+ this.isLast = unsupported;
92
+ }
93
+ get groupsView() {
94
+ return unsupported();
95
+ }
96
+ notifyLabelChanged() { }
97
+ get titleHeight() {
98
+ return unsupported();
99
+ }
100
+ get element() {
101
+ return unsupported();
102
+ }
103
+ get scopedContextKeyService() { return StandaloneServices.get(IContextKeyService); }
104
+ focus() {
105
+ }
106
+ }
107
+ const fakeActiveGroup = new EmptyEditorGroup();
29
108
  class SimpleEditorPane {
30
109
  constructor(editor) {
31
110
  this.editor = editor;
@@ -35,7 +114,7 @@ class SimpleEditorPane {
35
114
  this.onDidBlur = Event.None;
36
115
  this.input = undefined;
37
116
  this.options = undefined;
38
- this.group = undefined;
117
+ this.group = fakeActiveGroup;
39
118
  this.scopedContextKeyService = undefined;
40
119
  this.getViewState = unsupported;
41
120
  this.isVisible = unsupported;
@@ -165,6 +244,7 @@ let StandaloneEditorGroup = StandaloneEditorGroup_1 = class StandaloneEditorGrou
165
244
  this.editor = editor;
166
245
  this.scopedContextKeyService = scopedContextKeyService;
167
246
  this.active = false;
247
+ this.isTransient = () => false;
168
248
  this.windowId = mainWindow.vscodeWindowId;
169
249
  this.onDidFocus = this.editor.onDidFocusEditorWidget;
170
250
  this.onDidOpenEditorFail = Event.None;
@@ -478,7 +558,6 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
478
558
  return this.delegate.createAuxiliaryEditorPart(options);
479
559
  }
480
560
  get mainPart() { return this.delegate.mainPart; }
481
- get activePart() { return this.delegate.activePart; }
482
561
  getPart(container) {
483
562
  return this.delegate.getPart(container);
484
563
  }
@@ -506,4 +585,4 @@ MonacoDelegateEditorGroupsService = __decorate([
506
585
  ( __param(1, IInstantiationService))
507
586
  ], MonacoDelegateEditorGroupsService);
508
587
 
509
- export { MonacoDelegateEditorGroupsService, MonacoEditorService, wrapOpenEditor };
588
+ export { MonacoDelegateEditorGroupsService, MonacoEditorService, fakeActiveGroup, wrapOpenEditor };