@codingame/monaco-vscode-api 1.81.6 → 1.81.7-next.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.
@@ -1,11 +1,27 @@
1
+ import { __decorate, __param } from '../../node_modules/tslib/tslib.es6.js';
1
2
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
2
3
  import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
3
4
  import { isPreferredGroup, SIDE_GROUP } from '../../vscode/vs/workbench/services/editor/common/editorService.js';
4
- import { isResourceEditorInput, isEditorInput } from '../../vscode/vs/workbench/common/editor.js';
5
+ import { EditorCloseContext, isResourceEditorInput, isEditorInput } from '../../vscode/vs/workbench/common/editor.js';
5
6
  import { applyTextEditorOptions } from '../../vscode/vs/workbench/common/editor/editorOptions.js';
6
- import { Event } from 'monaco-editor/esm/vs/base/common/event.js';
7
7
  import { DEFAULT_EDITOR_MIN_DIMENSIONS, DEFAULT_EDITOR_MAX_DIMENSIONS } from '../../vscode/vs/workbench/browser/parts/editor/editor.js';
8
- import { StandaloneEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
8
+ import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
9
+ import { StandaloneCodeEditor, StandaloneEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
10
+ import { Disposable } from 'monaco-editor/esm/vs/base/common/lifecycle.js';
11
+ import { EditorService } from '../../vscode/vs/workbench/services/editor/browser/editorService.js';
12
+ import { IEditorGroupsService } from '../../vscode/vs/workbench/services/editor/common/editorGroupsService.js';
13
+ import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
14
+ import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
15
+ import { IWorkspaceTrustRequestService } from 'monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js';
16
+ import { IEditorResolverService } from '../../vscode/vs/workbench/services/editor/common/editorResolverService.js';
17
+ import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
18
+ import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
19
+ import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
20
+ import { ITextEditorService } from '../../vscode/vs/workbench/services/textfile/common/textEditorService.js';
21
+ import { IHostService } from '../../vscode/vs/workbench/services/host/browser/host.js';
22
+ import { Event, Emitter } from 'monaco-editor/esm/vs/base/common/event.js';
23
+ import { TextResourceEditorInput } from '../../vscode/vs/workbench/common/editor/textResourceEditorInput.js';
24
+ import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
9
25
  import { unsupported } from '../../tools.js';
10
26
  class SimpleEditorPane {
11
27
  constructor(editor) {
@@ -69,4 +85,356 @@ function wrapOpenEditor(textModelService, defaultBehavior, fallbackBahavior) {
69
85
  }
70
86
  return openEditor;
71
87
  }
72
- export { wrapOpenEditor };
88
+ let MonacoEditorService = class MonacoEditorService extends EditorService {
89
+ constructor(_openEditorFallback, _isEditorPartVisible, _editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService, textModelService) {
90
+ super(_editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService);
91
+ this._isEditorPartVisible = _isEditorPartVisible;
92
+ this.openEditor = wrapOpenEditor(textModelService, this.openEditor.bind(this), _openEditorFallback);
93
+ }
94
+ get activeTextEditorControl() {
95
+ const focusedCodeEditor = StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor();
96
+ if (focusedCodeEditor != null && focusedCodeEditor instanceof StandaloneCodeEditor) {
97
+ return focusedCodeEditor;
98
+ }
99
+ return super.activeTextEditorControl;
100
+ }
101
+ async openEditor(editor, optionsOrPreferredGroup, preferredGroup) {
102
+ if (!this._isEditorPartVisible()) {
103
+ return undefined;
104
+ }
105
+ return super.openEditor(editor, optionsOrPreferredGroup, preferredGroup);
106
+ }
107
+ };
108
+ MonacoEditorService = __decorate([
109
+ ( __param(2, IEditorGroupsService)),
110
+ ( __param(3, IInstantiationService)),
111
+ ( __param(4, IFileService)),
112
+ ( __param(5, IConfigurationService)),
113
+ ( __param(6, IWorkspaceContextService)),
114
+ ( __param(7, IUriIdentityService)),
115
+ ( __param(8, IEditorResolverService)),
116
+ ( __param(9, IWorkspaceTrustRequestService)),
117
+ ( __param(10, IHostService)),
118
+ ( __param(11, ITextEditorService)),
119
+ ( __param(12, ITextModelService))
120
+ ], MonacoEditorService);
121
+ class StandaloneEditorPane {
122
+ constructor(editor, input, group) {
123
+ this.editor = editor;
124
+ this.input = input;
125
+ this.group = group;
126
+ this.onDidChangeControl = Event.None;
127
+ this.options = undefined;
128
+ this.minimumWidth = 0;
129
+ this.maximumWidth = Number.POSITIVE_INFINITY;
130
+ this.minimumHeight = 0;
131
+ this.maximumHeight = Number.POSITIVE_INFINITY;
132
+ this.onDidChangeSizeConstraints = Event.None;
133
+ this.scopedContextKeyService = undefined;
134
+ this.onDidFocus = this.editor.onDidFocusEditorWidget;
135
+ this.onDidBlur = this.editor.onDidBlurEditorWidget;
136
+ }
137
+ getControl() {
138
+ return this.editor;
139
+ }
140
+ getViewState() {
141
+ return undefined;
142
+ }
143
+ isVisible() {
144
+ return true;
145
+ }
146
+ hasFocus() {
147
+ return this.editor.hasWidgetFocus();
148
+ }
149
+ getId() {
150
+ return this.editor.getId();
151
+ }
152
+ getTitle() {
153
+ return undefined;
154
+ }
155
+ focus() {
156
+ this.editor.focus();
157
+ }
158
+ }
159
+ let StandaloneEditorGroup = class StandaloneEditorGroup extends Disposable {
160
+ constructor(editor, instantiationService, scopedContextKeyService) {
161
+ super();
162
+ this.editor = editor;
163
+ this.scopedContextKeyService = scopedContextKeyService;
164
+ this.active = false;
165
+ this.onDidFocus = this.editor.onDidFocusEditorWidget;
166
+ this.onDidOpenEditorFail = Event.None;
167
+ this.whenRestored = Promise.resolve();
168
+ this.disposed = false;
169
+ this.notifyIndexChanged = unsupported;
170
+ this.relayout = unsupported;
171
+ this.toJSON = unsupported;
172
+ this.minimumWidth = 0;
173
+ this.maximumWidth = Number.POSITIVE_INFINITY;
174
+ this.minimumHeight = 0;
175
+ this.maximumHeight = Number.POSITIVE_INFINITY;
176
+ this.onDidChange = this.editor.onDidLayoutChange;
177
+ this.layout = () => this.editor.layout();
178
+ this._onDidModelChange = new Emitter();
179
+ this.onDidModelChange = this._onDidModelChange.event;
180
+ this.onWillDispose = this.editor.onDidDispose;
181
+ this._onDidActiveEditorChange = new Emitter();
182
+ this.onDidActiveEditorChange = this._onDidActiveEditorChange.event;
183
+ this.onWillCloseEditor = Event.None;
184
+ this._onDidCloseEditor = new Emitter();
185
+ this.onDidCloseEditor = this._onDidCloseEditor.event;
186
+ this.onWillMoveEditor = Event.None;
187
+ this._onWillOpenEditor = new Emitter();
188
+ this.onWillOpenEditor = this._onWillOpenEditor.event;
189
+ this.id = --StandaloneEditorGroup.idCounter;
190
+ this.index = -1;
191
+ this.label = `standalone editor ${this.editor.getId()}`;
192
+ this.ariaLabel = `standalone editor ${this.editor.getId()}`;
193
+ this.previewEditor = null;
194
+ this.isLocked = true;
195
+ this.stickyCount = 0;
196
+ this.getEditors = () => this.editors;
197
+ this.findEditors = (resource) => this.pane != null && ( resource.toString()) === ( this.pane.input.resource.toString()) ? [this.pane.input] : [];
198
+ this.getEditorByIndex = (index) => this.pane != null && index === 0 ? this.pane.input : undefined;
199
+ this.getIndexOfEditor = (editorInput) => this.pane != null && this.pane.input === editorInput ? 0 : -1;
200
+ this.openEditor = unsupported;
201
+ this.openEditors = unsupported;
202
+ this.isPinned = () => false;
203
+ this.isSticky = () => false;
204
+ this.isActive = () => this.editor.hasWidgetFocus();
205
+ this.contains = unsupported;
206
+ this.moveEditor = unsupported;
207
+ this.moveEditors = unsupported;
208
+ this.copyEditor = unsupported;
209
+ this.copyEditors = unsupported;
210
+ this.closeEditor = unsupported;
211
+ this.closeEditors = unsupported;
212
+ this.closeAllEditors = unsupported;
213
+ this.replaceEditors = unsupported;
214
+ this.pinEditor = unsupported;
215
+ this.stickEditor = unsupported;
216
+ this.unstickEditor = unsupported;
217
+ this.lock = unsupported;
218
+ this.isFirst = unsupported;
219
+ this.isLast = unsupported;
220
+ const onNewModel = (uri) => {
221
+ const editorInput = instantiationService.createInstance(TextResourceEditorInput, uri, undefined, undefined, undefined, undefined);
222
+ this._onWillOpenEditor.fire({
223
+ editor: editorInput,
224
+ groupId: this.id
225
+ });
226
+ this.pane = new StandaloneEditorPane(editor, editorInput, this);
227
+ this._onDidModelChange.fire({
228
+ kind: 3 ,
229
+ editor: editorInput,
230
+ editorIndex: 0
231
+ });
232
+ this._onDidActiveEditorChange.fire({
233
+ editor: editorInput
234
+ });
235
+ };
236
+ const onRemovedModel = (uri) => {
237
+ if (this.pane != null && ( this.pane.input.resource.toString()) === ( uri.toString())) {
238
+ const pane = this.pane;
239
+ this.pane = undefined;
240
+ this._onDidModelChange.fire({
241
+ kind: 4 ,
242
+ editorIndex: 0
243
+ });
244
+ this._onDidActiveEditorChange.fire({
245
+ editor: undefined
246
+ });
247
+ this._onDidCloseEditor.fire({
248
+ context: EditorCloseContext.UNKNOWN,
249
+ editor: pane.input,
250
+ groupId: this.id,
251
+ index: 0,
252
+ sticky: false
253
+ });
254
+ }
255
+ };
256
+ editor.onDidChangeModel((e) => {
257
+ if (e.oldModelUrl != null) {
258
+ onRemovedModel(e.oldModelUrl);
259
+ }
260
+ if (e.newModelUrl != null) {
261
+ onNewModel(e.newModelUrl);
262
+ }
263
+ });
264
+ this._register({
265
+ dispose: () => {
266
+ const model = editor.getModel();
267
+ if (model != null) {
268
+ onRemovedModel(model.uri);
269
+ }
270
+ }
271
+ });
272
+ const currentModel = editor.getModel();
273
+ if (currentModel != null) {
274
+ const editorInput = instantiationService.createInstance(TextResourceEditorInput, currentModel.uri, undefined, undefined, undefined, undefined);
275
+ this.pane = new StandaloneEditorPane(editor, editorInput, this);
276
+ }
277
+ }
278
+ get titleHeight() { return unsupported(); }
279
+ setActive(isActive) {
280
+ this.active = isActive;
281
+ }
282
+ get element() { return unsupported(); }
283
+ get activeEditorPane() {
284
+ return this.pane;
285
+ }
286
+ get activeEditor() {
287
+ return this.pane?.input ?? null;
288
+ }
289
+ get count() {
290
+ return this.pane != null ? 1 : 0;
291
+ }
292
+ get isEmpty() {
293
+ return this.pane == null;
294
+ }
295
+ get editors() {
296
+ return this.pane != null ? [this.pane.input] : [];
297
+ }
298
+ focus() {
299
+ this.editor.focus();
300
+ }
301
+ };
302
+ StandaloneEditorGroup.idCounter = 0;
303
+ StandaloneEditorGroup = __decorate([
304
+ ( __param(1, IInstantiationService)),
305
+ ( __param(2, IContextKeyService))
306
+ ], StandaloneEditorGroup);
307
+ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService extends Disposable {
308
+ constructor(delegate, instantiationService) {
309
+ super();
310
+ this.delegate = delegate;
311
+ this._serviceBrand = undefined;
312
+ this.additionalGroups = [];
313
+ this.activeGroupOverride = undefined;
314
+ this._onDidChangeActiveGroup = new Emitter();
315
+ this.onDidChangeActiveGroup = Event.any(this._onDidChangeActiveGroup.event, this.delegate.onDidChangeActiveGroup);
316
+ this._onDidAddGroup = new Emitter();
317
+ this.onDidAddGroup = Event.any(this._onDidAddGroup.event, this.delegate.onDidAddGroup);
318
+ this._onDidRemoveGroup = new Emitter();
319
+ this.onDidRemoveGroup = Event.any(this._onDidRemoveGroup.event, this.delegate.onDidRemoveGroup);
320
+ this.onDidMoveGroup = this.delegate.onDidMoveGroup;
321
+ this.onDidActivateGroup = this.delegate.onDidActivateGroup;
322
+ this.onDidLayout = this.delegate.onDidLayout;
323
+ this.onDidScroll = this.delegate.onDidScroll;
324
+ this.onDidChangeGroupIndex = this.delegate.onDidChangeGroupIndex;
325
+ this.onDidChangeGroupLocked = this.delegate.onDidChangeGroupLocked;
326
+ this.getLayout = () => {
327
+ return this.delegate.getLayout();
328
+ };
329
+ this.getGroups = (order) => {
330
+ return [...this.additionalGroups, ...this.delegate.getGroups(order)];
331
+ };
332
+ this.getGroup = (identifier) => {
333
+ return this.delegate.getGroup(identifier) ?? this.additionalGroups.find(group => group.id === identifier);
334
+ };
335
+ this.activateGroup = (...args) => {
336
+ return this.delegate.activateGroup(...args);
337
+ };
338
+ this.getSize = (...args) => {
339
+ return this.delegate.getSize(...args);
340
+ };
341
+ this.setSize = (...args) => {
342
+ return this.delegate.setSize(...args);
343
+ };
344
+ this.arrangeGroups = (...args) => {
345
+ return this.delegate.arrangeGroups(...args);
346
+ };
347
+ this.applyLayout = (...args) => {
348
+ return this.delegate.applyLayout(...args);
349
+ };
350
+ this.centerLayout = (...args) => {
351
+ return this.delegate.centerLayout(...args);
352
+ };
353
+ this.isLayoutCentered = (...args) => {
354
+ return this.delegate.isLayoutCentered(...args);
355
+ };
356
+ this.setGroupOrientation = (...args) => {
357
+ return this.delegate.setGroupOrientation(...args);
358
+ };
359
+ this.findGroup = (...args) => {
360
+ return this.delegate.findGroup(...args);
361
+ };
362
+ this.addGroup = (...args) => {
363
+ return this.delegate.addGroup(...args);
364
+ };
365
+ this.removeGroup = (...args) => {
366
+ return this.delegate.removeGroup(...args);
367
+ };
368
+ this.moveGroup = (...args) => {
369
+ return this.delegate.moveGroup(...args);
370
+ };
371
+ this.mergeGroup = (...args) => {
372
+ return this.delegate.mergeGroup(...args);
373
+ };
374
+ this.mergeAllGroups = (...args) => {
375
+ return this.delegate.mergeAllGroups(...args);
376
+ };
377
+ this.copyGroup = (...args) => {
378
+ return this.delegate.copyGroup(...args);
379
+ };
380
+ this.enforcePartOptions = (...args) => {
381
+ return this.delegate.enforcePartOptions(...args);
382
+ };
383
+ this.onDidChangeEditorPartOptions = this.delegate.onDidChangeEditorPartOptions;
384
+ setTimeout(() => {
385
+ const codeEditorService = StandaloneServices.get(ICodeEditorService);
386
+ const handleCodeEditor = (editor) => {
387
+ if (editor instanceof StandaloneEditor) {
388
+ const onEditorFocused = () => {
389
+ this.activeGroupOverride = this.additionalGroups.find(group => group.editor === editor);
390
+ this._onDidChangeActiveGroup.fire(this.activeGroup);
391
+ };
392
+ editor.onDidFocusEditorText(onEditorFocused);
393
+ editor.onDidFocusEditorWidget(onEditorFocused);
394
+ if (editor.hasWidgetFocus()) {
395
+ onEditorFocused();
396
+ }
397
+ const newGroup = instantiationService.createInstance(StandaloneEditorGroup, editor);
398
+ this.additionalGroups.push(newGroup);
399
+ this._onDidAddGroup.fire(newGroup);
400
+ }
401
+ };
402
+ const handleCodeEditorRemoved = (editor) => {
403
+ if (editor instanceof StandaloneEditor) {
404
+ const removedGroup = this.additionalGroups.find(group => group.editor === editor);
405
+ if (removedGroup != null) {
406
+ removedGroup.dispose();
407
+ if (this.activeGroupOverride === removedGroup) {
408
+ this.activeGroupOverride = undefined;
409
+ this._onDidChangeActiveGroup.fire(this.activeGroup);
410
+ }
411
+ this.additionalGroups = this.additionalGroups.filter(group => group !== removedGroup);
412
+ this._onDidRemoveGroup.fire(removedGroup);
413
+ }
414
+ }
415
+ };
416
+ this._register(codeEditorService.onCodeEditorAdd(handleCodeEditor));
417
+ this._register(codeEditorService.onCodeEditorRemove(handleCodeEditorRemoved));
418
+ codeEditorService.listCodeEditors().forEach(handleCodeEditor);
419
+ });
420
+ }
421
+ get groups() {
422
+ return [...this.additionalGroups, ...this.delegate.groups];
423
+ }
424
+ get activeGroup() {
425
+ return this.activeGroupOverride ?? this.delegate.activeGroup;
426
+ }
427
+ get contentDimension() { return this.delegate.contentDimension; }
428
+ get sideGroup() { return this.delegate.sideGroup; }
429
+ get count() { return this.delegate.count + this.additionalGroups.length; }
430
+ get orientation() { return this.delegate.orientation; }
431
+ get isReady() { return this.delegate.isReady; }
432
+ get whenReady() { return this.delegate.whenReady; }
433
+ get whenRestored() { return this.delegate.whenRestored; }
434
+ get hasRestorableState() { return this.delegate.hasRestorableState; }
435
+ get partOptions() { return this.delegate.partOptions; }
436
+ };
437
+ MonacoDelegateEditorGroupsService = __decorate([
438
+ ( __param(1, IInstantiationService))
439
+ ], MonacoDelegateEditorGroupsService);
440
+ export { MonacoDelegateEditorGroupsService, MonacoEditorService, wrapOpenEditor };
@@ -1,18 +1,18 @@
1
+ import { IDisposable } from '../vscode/vs/base/common/lifecycle.js';
2
+ export { IReference } from '../vscode/vs/base/common/lifecycle.js';
3
+ import { ServicesAccessor } from '../vscode/vs/platform/instantiation/common/instantiation.js';
4
+ export { IEditorOptions } from '../vscode/vs/platform/editor/common/editor.js';
5
+ import { IEditorCloseHandler, EditorInput } from '../vscode/vs/workbench/common/editor/editorInput.js';
6
+ export { IResolvedTextEditorModel } from '../vscode/vs/editor/common/services/resolverService.js';
1
7
  import { IEditorOverrideServices } from '../vscode/vs/editor/standalone/browser/standaloneServices.js';
2
8
  import { ViewContainerLocation } from '../vscode/vs/workbench/common/views.js';
3
- import { ServicesAccessor } from '../vscode/vs/platform/instantiation/common/instantiation.js';
4
9
  export { SidebarPart } from '../vscode/vs/workbench/browser/parts/sidebar/sidebarPart.js';
5
10
  export { ActivityService } from '../vscode/vs/workbench/services/activity/browser/activityService.js';
6
11
  export { ActivitybarPart } from '../vscode/vs/workbench/browser/parts/activitybar/activitybarPart.js';
7
- import { IDisposable } from '../vscode/vs/base/common/lifecycle.js';
8
- export { IReference } from '../vscode/vs/base/common/lifecycle.js';
9
12
  export { HoverService } from '../vscode/vs/workbench/services/hover/browser/hoverService.js';
10
13
  export { PanelPart } from '../vscode/vs/workbench/browser/parts/panel/panelPart.js';
11
14
  import { Part } from '../vscode/vs/workbench/browser/part.js';
12
- export { IEditorOptions } from '../vscode/vs/platform/editor/common/editor.js';
13
15
  import { Codicon } from '../vscode/vs/base/common/codicons.js';
14
- import { IEditorCloseHandler, EditorInput } from '../vscode/vs/workbench/common/editor/editorInput.js';
15
- export { IResolvedTextEditorModel } from '../vscode/vs/editor/common/services/resolverService.js';
16
16
  export { StatusbarPart } from '../vscode/vs/workbench/browser/parts/statusbar/statusbarPart.js';
17
17
  import { Parts } from '../vscode/vs/workbench/services/layout/browser/layoutService.js';
18
18
  export { ConfirmResult } from '../vscode/vs/platform/dialogs/common/dialogs.js';
@@ -46,7 +46,6 @@ import '../vscode/vs/workbench/contrib/files/browser/files.contribution2.js';
46
46
  import { Codicon } from 'monaco-editor/esm/vs/base/common/codicons.js';
47
47
  import { IEditorGroupsService } from '../vscode/vs/workbench/services/editor/common/editorGroupsService.js';
48
48
  import { IEditorDropService } from '../vscode/vs/workbench/services/editor/browser/editorDropService.js';
49
- import { EditorService } from '../vscode/vs/workbench/services/editor/browser/editorService.js';
50
49
  import { IEditorService } from '../vscode/vs/workbench/services/editor/common/editorService.js';
51
50
  import { IEditorResolverService } from '../vscode/vs/workbench/services/editor/common/editorResolverService.js';
52
51
  import { EditorResolverService } from '../vscode/vs/workbench/services/editor/browser/editorResolverService.js';
@@ -56,13 +55,6 @@ import { ContextViewService } from 'monaco-editor/esm/vs/platform/contextview/br
56
55
  import { ICodeEditorService } from 'monaco-editor/esm/vs/editor/browser/services/codeEditorService.js';
57
56
  import { EditorInput } from '../vscode/vs/workbench/common/editor/editorInput.js';
58
57
  import { EditorExtensions } from '../vscode/vs/workbench/common/editor.js';
59
- import { ITextModelService } from 'monaco-editor/esm/vs/editor/common/services/resolverService.js';
60
- import { IFileService } from 'monaco-editor/esm/vs/platform/files/common/files.js';
61
- import { IConfigurationService } from 'monaco-editor/esm/vs/platform/configuration/common/configuration.js';
62
- import { IWorkspaceContextService } from 'monaco-editor/esm/vs/platform/workspace/common/workspace.js';
63
- import { IUriIdentityService } from 'monaco-editor/esm/vs/platform/uriIdentity/common/uriIdentity.js';
64
- import { IWorkspaceTrustRequestService } from 'monaco-editor/esm/vs/platform/workspace/common/workspaceTrust.js';
65
- import { IHostService } from '../vscode/vs/workbench/services/host/browser/host.js';
66
58
  import { ITextEditorService, TextEditorService } from '../vscode/vs/workbench/services/textfile/common/textEditorService.js';
67
59
  import { CodeEditorService } from '../vscode/vs/workbench/services/editor/browser/codeEditorService.js';
68
60
  import { IUntitledTextEditorService, UntitledTextEditorService } from '../vscode/vs/workbench/services/untitled/common/untitledTextEditorService.js';
@@ -93,8 +85,7 @@ import { IStorageService } from 'monaco-editor/esm/vs/platform/storage/common/st
93
85
  import { IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
94
86
  export { ConfirmResult } from '../override/vs/platform/dialogs/common/dialogs.js';
95
87
  import { ILayoutService } from 'monaco-editor/esm/vs/platform/layout/browser/layoutService.js';
96
- import { StandaloneCodeEditor } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneCodeEditor.js';
97
- import { wrapOpenEditor } from './tools/editor.js';
88
+ import { MonacoEditorService, MonacoDelegateEditorGroupsService } from './tools/editor.js';
98
89
  import getServiceOverride$2 from './bulkEdit.js';
99
90
  import getServiceOverride$1 from './layout.js';
100
91
  import getServiceOverride$3 from './quickaccess.js';
@@ -367,38 +358,76 @@ function isEditorPartVisible() {
367
358
  const container = StandaloneServices.get(IEditorGroupsService).getContainer();
368
359
  return container != null && isElementVisible(container);
369
360
  }
370
- let MonacoEditorService = class MonacoEditorService extends EditorService {
371
- constructor(_openEditorFallback, _editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService, textModelService) {
372
- super(_editorGroupService, instantiationService, fileService, configurationService, contextService, uriIdentityService, editorResolverService, workspaceTrustRequestService, hostService, textEditorService);
373
- this.openEditor = wrapOpenEditor(textModelService, this.openEditor.bind(this), _openEditorFallback);
361
+ let MonacoEditorPart = class MonacoEditorPart extends MonacoDelegateEditorGroupsService {
362
+ constructor(instantiationService) {
363
+ super(instantiationService.createInstance(EditorPart), instantiationService);
364
+ this.onDidChangeSizeConstraints = this.delegate.onDidChangeSizeConstraints;
365
+ this.restoreGroup = (...args) => {
366
+ return this.delegate.restoreGroup(...args);
367
+ };
368
+ this.isGroupMaximized = (...args) => {
369
+ return this.delegate.isGroupMaximized(...args);
370
+ };
371
+ this.createEditorDropTarget = (...args) => {
372
+ return this.delegate.createEditorDropTarget(...args);
373
+ };
374
+ this.updateStyles = (...args) => {
375
+ return this.delegate.updateStyles(...args);
376
+ };
377
+ this.setBoundarySashes = (...args) => {
378
+ return this.delegate.setBoundarySashes(...args);
379
+ };
380
+ this.layout = (...args) => {
381
+ return this.delegate.layout(...args);
382
+ };
383
+ this.toJSON = (...args) => {
384
+ return this.delegate.toJSON(...args);
385
+ };
386
+ this.onDidVisibilityChange = this.delegate.onDidVisibilityChange;
387
+ this.create = (...args) => {
388
+ return this.delegate.create(...args);
389
+ };
390
+ this.getContainer = (...args) => {
391
+ return this.delegate.getContainer(...args);
392
+ };
393
+ this.setVisible = (...args) => {
394
+ return this.delegate.setVisible(...args);
395
+ };
396
+ this.getId = (...args) => {
397
+ return this.delegate.getId(...args);
398
+ };
374
399
  }
375
- get activeTextEditorControl() {
376
- const focusedCodeEditor = StandaloneServices.get(ICodeEditorService).getFocusedCodeEditor();
377
- if (focusedCodeEditor != null && focusedCodeEditor instanceof StandaloneCodeEditor) {
378
- return focusedCodeEditor;
379
- }
380
- return super.activeTextEditorControl;
400
+ get minimumWidth() {
401
+ return this.delegate.minimumWidth;
381
402
  }
382
- async openEditor(editor, optionsOrPreferredGroup, preferredGroup) {
383
- if (!isEditorPartVisible()) {
384
- return undefined;
385
- }
386
- return super.openEditor(editor, optionsOrPreferredGroup, preferredGroup);
403
+ get maximumWidth() {
404
+ return this.delegate.maximumWidth;
405
+ }
406
+ get minimumHeight() {
407
+ return this.delegate.minimumHeight;
408
+ }
409
+ get maximumHeight() {
410
+ return this.delegate.maximumHeight;
411
+ }
412
+ get snap() {
413
+ return this.delegate.snap;
414
+ }
415
+ get onDidChange() {
416
+ return this.delegate.onDidChange;
417
+ }
418
+ get priority() {
419
+ return this.delegate.priority;
420
+ }
421
+ get dimension() {
422
+ return this.delegate.dimension;
423
+ }
424
+ get element() {
425
+ return this.delegate.element;
387
426
  }
388
427
  };
389
- MonacoEditorService = __decorate([
390
- ( __param(1, IEditorGroupsService)),
391
- ( __param(2, IInstantiationService)),
392
- ( __param(3, IFileService)),
393
- ( __param(4, IConfigurationService)),
394
- ( __param(5, IWorkspaceContextService)),
395
- ( __param(6, IUriIdentityService)),
396
- ( __param(7, IEditorResolverService)),
397
- ( __param(8, IWorkspaceTrustRequestService)),
398
- ( __param(9, IHostService)),
399
- ( __param(10, ITextEditorService)),
400
- ( __param(11, ITextModelService))
401
- ], MonacoEditorService);
428
+ MonacoEditorPart = __decorate([
429
+ ( __param(0, IInstantiationService))
430
+ ], MonacoEditorPart);
402
431
  let webviewIframeAlternateDomains;
403
432
  registerAssets({
404
433
  'vs/workbench/contrib/webview/browser/pre/service-worker.js': () => changeUrlDomain(new URL('../assets/service-worker.js', import.meta.url).href, webviewIframeAlternateDomains),
@@ -452,10 +481,10 @@ function getServiceOverride(openEditorFallback, _webviewIframeAlternateDomains)
452
481
  [( IExplorerService.toString())]: new SyncDescriptor(ExplorerService, [], true),
453
482
  [( ICodeEditorService.toString())]: new SyncDescriptor(CodeEditorService, [], true),
454
483
  [( ITextEditorService.toString())]: new SyncDescriptor(TextEditorService, [], false),
455
- [( IEditorGroupsService.toString())]: new SyncDescriptor(EditorPart, [], false),
484
+ [( IEditorGroupsService.toString())]: new SyncDescriptor(MonacoEditorPart, [], false),
456
485
  [( IStatusbarService.toString())]: new SyncDescriptor(StatusbarPart, [], false),
457
486
  [( IEditorDropService.toString())]: new SyncDescriptor(EditorDropService, [], true),
458
- [( IEditorService.toString())]: new SyncDescriptor(MonacoEditorService, [openEditorFallback], false),
487
+ [( IEditorService.toString())]: new SyncDescriptor(MonacoEditorService, [openEditorFallback, isEditorPartVisible], false),
459
488
  [( IEditorResolverService.toString())]: new SyncDescriptor(EditorResolverService, [], false),
460
489
  [( IBreadcrumbsService.toString())]: new SyncDescriptor(BreadcrumbsService, [], true),
461
490
  [( IContextViewService.toString())]: new SyncDescriptor(ContextViewService, [], true),
@@ -1,3 +1,7 @@
1
+ import { ServiceIdentifier } from '../../instantiation/common/instantiation.js';
2
+ import { Event } from '../../../base/common/event.js';
3
+ import { URI } from '../../../base/common/uri.js';
4
+
1
5
  interface WorkspaceTrustRequestButton {
2
6
  readonly label: string;
3
7
  readonly type: 'ContinueWithTrust' | 'ContinueWithoutTrust' | 'Manage' | 'Cancel';
@@ -6,5 +10,23 @@ interface WorkspaceTrustRequestOptions {
6
10
  readonly buttons?: WorkspaceTrustRequestButton[];
7
11
  readonly message?: string;
8
12
  }
13
+ declare const enum WorkspaceTrustUriResponse {
14
+ Open = 1,
15
+ OpenInNewWindow = 2,
16
+ Cancel = 3
17
+ }
18
+ declare const IWorkspaceTrustRequestService: ServiceIdentifier<IWorkspaceTrustRequestService>;
19
+ interface IWorkspaceTrustRequestService {
20
+ readonly _serviceBrand: undefined;
21
+ readonly onDidInitiateOpenFilesTrustRequest: Event<void>;
22
+ readonly onDidInitiateWorkspaceTrustRequest: Event<WorkspaceTrustRequestOptions | undefined>;
23
+ readonly onDidInitiateWorkspaceTrustRequestOnStartup: Event<void>;
24
+ completeOpenFilesTrustRequest(result: WorkspaceTrustUriResponse, saveResponse?: boolean): Promise<void>;
25
+ requestOpenFilesTrust(openFiles: URI[]): Promise<WorkspaceTrustUriResponse>;
26
+ cancelWorkspaceTrustRequest(): void;
27
+ completeWorkspaceTrustRequest(trusted?: boolean): Promise<void>;
28
+ requestWorkspaceTrust(options?: WorkspaceTrustRequestOptions): Promise<boolean | undefined>;
29
+ requestWorkspaceTrustOnStartup(): void;
30
+ }
9
31
 
10
- export { WorkspaceTrustRequestButton, WorkspaceTrustRequestOptions };
32
+ export { IWorkspaceTrustRequestService, WorkspaceTrustRequestButton, WorkspaceTrustRequestOptions, WorkspaceTrustUriResponse };
@@ -0,0 +1,20 @@
1
+ import { IEditorIdentifier } from '../../../common/editor.js';
2
+ import { Event } from '../../../../base/common/event.js';
3
+ import { IEditorService } from '../../../services/editor/common/editorService.js';
4
+
5
+ /**
6
+ * A sub-interface of IEditorService to hide some workbench-core specific
7
+ * events from clients.
8
+ */
9
+ interface EditorServiceImpl extends IEditorService {
10
+ /**
11
+ * Emitted when an editor failed to open.
12
+ */
13
+ readonly onDidOpenEditorFail: Event<IEditorIdentifier>;
14
+ /**
15
+ * Emitted when the list of most recently active editors change.
16
+ */
17
+ readonly onDidMostRecentlyActiveEditorsChange: Event<void>;
18
+ }
19
+
20
+ export { EditorServiceImpl };