@codingame/monaco-vscode-views-service-override 11.1.2 → 12.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/views.js DELETED
@@ -1,566 +0,0 @@
1
- import { __decorate, __param } from 'vscode/external/tslib/tslib.es6.js';
2
- import { StandaloneServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
3
- import { SyncDescriptor } from 'vscode/vscode/vs/platform/instantiation/common/descriptors';
4
- import { IViewDescriptorService } from 'vscode/vscode/vs/workbench/common/views.service';
5
- import { IInstantiationService } from 'vscode/vscode/vs/platform/instantiation/common/instantiation';
6
- import { SidebarPart } from '@codingame/monaco-vscode-view-common-views-workbench-common/vscode/vs/workbench/browser/parts/sidebar/sidebarPart';
7
- export { SidebarPart } from '@codingame/monaco-vscode-view-common-views-workbench-common/vscode/vs/workbench/browser/parts/sidebar/sidebarPart';
8
- export { ActivityService } from 'vscode/vscode/vs/workbench/services/activity/browser/activityService';
9
- import { IPaneCompositePartService } from 'vscode/vscode/vs/workbench/services/panecomposite/browser/panecomposite.service';
10
- export { ActivitybarPart } from '@codingame/monaco-vscode-view-common-views-workbench-common/vscode/vs/workbench/browser/parts/activitybar/activitybarPart';
11
- import { PanelPart } from '@codingame/monaco-vscode-view-common-views-workbench-common/vscode/vs/workbench/browser/parts/panel/panelPart';
12
- export { PanelPart } from '@codingame/monaco-vscode-view-common-views-workbench-common/vscode/vs/workbench/browser/parts/panel/panelPart';
13
- import { URI } from 'vscode/vscode/vs/base/common/uri';
14
- export { GroupOrientation } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService';
15
- import { IEditorGroupsService } from 'vscode/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
16
- import { IEditorService } from 'vscode/vscode/vs/workbench/services/editor/common/editorService.service';
17
- import { pathsToEditors, isResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor';
18
- export { EditorInputCapabilities } from 'vscode/vscode/vs/workbench/common/editor';
19
- import { positionToString } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
20
- export { Parts, Position } from 'vscode/vscode/vs/workbench/services/layout/browser/layoutService';
21
- import { IStorageService } from 'vscode/vscode/vs/platform/storage/common/storage.service';
22
- import { IFileService } from 'vscode/vscode/vs/platform/files/common/files.service';
23
- import { ILayoutService } from 'vscode/vscode/vs/platform/layout/browser/layoutService.service';
24
- import { ILifecycleService } from 'vscode/vscode/vs/workbench/services/lifecycle/common/lifecycle.service';
25
- import { AuxiliaryBarPart } from '@codingame/monaco-vscode-view-common-views-workbench-common/vscode/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart';
26
- import { ILogService } from 'vscode/vscode/vs/platform/log/common/log.service';
27
- import { mark } from 'vscode/vscode/vs/base/common/performance';
28
- import { IExtensionService } from 'vscode/vscode/vs/workbench/services/extensions/common/extensions.service';
29
- import { Promises } from 'vscode/vscode/vs/base/common/async';
30
- import { isWeb } from 'vscode/vscode/vs/base/common/platform';
31
- import { IEnvironmentService } from 'vscode/vscode/vs/platform/environment/common/environment.service';
32
- import { isTemporaryWorkspace } from 'vscode/vscode/vs/platform/workspace/common/workspace';
33
- import { IWorkspaceContextService } from 'vscode/vscode/vs/platform/workspace/common/workspace.service';
34
- import { IConfigurationService } from 'vscode/vscode/vs/platform/configuration/common/configuration.service';
35
- import { coalesce } from 'vscode/vscode/vs/base/common/arrays';
36
- import { IWorkingCopyBackupService } from 'vscode/vscode/vs/workbench/services/workingCopy/common/workingCopyBackup.service';
37
- import { EditorParts } from '@codingame/monaco-vscode-view-common-views-workbench-common/vscode/vs/workbench/browser/parts/editor/editorParts';
38
- import { MonacoDelegateEditorGroupsService, MonacoEditorService } from './tools/editor.js';
39
- import getServiceOverride$2 from '@codingame/monaco-vscode-quickaccess-service-override';
40
- import getServiceOverride$3 from '@codingame/monaco-vscode-keybindings-service-override';
41
- import getServiceOverride$1 from '@codingame/monaco-vscode-view-common-service-override';
42
- import { onRenderWorkbench } from 'vscode/lifecycle';
43
- export { EditorPane, SimpleEditorInput, SimpleEditorPane, getPanelPosition, getSideBarPosition, isPartVisibile, onDidChangePanelPosition, onDidChangeSideBarPosition, registerCustomView, registerEditor, registerEditorPane, registerEditorSerializer, setPartVisibility, viewContainerRegistry, viewRegistry } from './tools/views.js';
44
- export { ViewContainerLocation } from 'vscode/vscode/vs/workbench/common/views';
45
- export { ViewPaneContainer } from 'vscode/vscode/vs/workbench/browser/parts/views/viewPaneContainer';
46
- export { ConfirmResult } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
47
- export { RegisteredEditorPriority } from 'vscode/vscode/vs/workbench/services/editor/common/editorResolverService';
48
- export { AbstractResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/resourceEditorInput';
49
- export { AbstractTextResourceEditorInput } from 'vscode/vscode/vs/workbench/common/editor/textResourceEditorInput';
50
- export { EditorInput } from 'vscode/vscode/vs/workbench/common/editor/editorInput';
51
- export { SplitView } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
52
- export { DomScrollableElement } from 'vscode/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
53
-
54
- function createPart(id, role, classes) {
55
- const part = document.createElement(role === 'status' ? 'footer' : 'div');
56
- part.classList.add('part', 'monaco-workbench-part', ...classes);
57
- part.id = id;
58
- part.setAttribute('role', role);
59
- if (role === 'status') {
60
- part.setAttribute('aria-live', 'off');
61
- }
62
- return part;
63
- }
64
- function layoutPart(part) {
65
- const parent = part.getContainer()?.parentNode;
66
- if (parent == null) {
67
- return;
68
- }
69
- part.layout(Math.max(part.minimumWidth, Math.min(part.maximumWidth, parent.offsetWidth)), Math.max(part.minimumHeight, Math.min(part.maximumHeight, parent.offsetHeight)), parent.offsetTop, parent.offsetLeft);
70
- }
71
- function renderPart(partContainer, part) {
72
- partContainer.oncontextmenu = () => false;
73
- function layout() {
74
- layoutPart(part);
75
- }
76
- part.onDidVisibilityChange((visible) => {
77
- if (visible) {
78
- layout();
79
- }
80
- });
81
- layout();
82
- }
83
- function getPart(part) {
84
- return StandaloneServices.get(ILayoutService).getPart(part);
85
- }
86
- function _attachPart(part, container) {
87
- container.append(part.getContainer());
88
- const observer = new ResizeObserver(() => layoutPart(part));
89
- observer.observe(container);
90
- return {
91
- dispose() {
92
- return observer.disconnect();
93
- }
94
- };
95
- }
96
- function attachPart(part, container) {
97
- const _part = getPart(part);
98
- if (_part == null) {
99
- throw new Error('Part not found');
100
- }
101
- return _attachPart(_part, container);
102
- }
103
- function onPartVisibilityChange(part, listener) {
104
- const _part = getPart(part);
105
- if (_part == null) {
106
- throw new Error('Part not found');
107
- }
108
- return _part.onDidVisibilityChange(listener);
109
- }
110
- function renderActivitybarPar(container) {
111
- return attachPart("workbench.parts.activitybar" , container);
112
- }
113
- function renderSidebarPart(container) {
114
- return attachPart("workbench.parts.sidebar" , container);
115
- }
116
- function renderPanelPart(container) {
117
- return attachPart("workbench.parts.panel" , container);
118
- }
119
- function renderAuxiliaryPart(container) {
120
- return attachPart("workbench.parts.auxiliarybar" , container);
121
- }
122
- function renderEditorPart(container) {
123
- return attachPart("workbench.parts.editor" , container);
124
- }
125
- function renderStatusBarPart(container) {
126
- return attachPart("workbench.parts.statusbar" , container);
127
- }
128
- function isElementVisible(el) {
129
- if (!el.isConnected) {
130
- return false;
131
- }
132
- if (el.checkVisibility != null) {
133
- return el.checkVisibility({
134
- checkOpacity: true,
135
- checkVisibilityCSS: true
136
- });
137
- }
138
- return el.offsetHeight > 0 && el.offsetWidth > 0;
139
- }
140
- function isEditorPartVisible() {
141
- const container = StandaloneServices.get(IEditorGroupsService).mainPart.getContainer();
142
- return container != null && isElementVisible(container);
143
- }
144
- let MonacoEditorParts = class MonacoEditorParts extends MonacoDelegateEditorGroupsService {
145
- constructor(instantiationService) {
146
- super(instantiationService.createInstance(EditorParts), false, instantiationService);
147
- this.restoreGroup = (...args) => {
148
- return this.delegate.restoreGroup(...args);
149
- };
150
- }
151
- getId() {
152
- return 'standalone';
153
- }
154
- updateStyles() { }
155
- registerPart(part) {
156
- return this.delegate.registerPart(part);
157
- }
158
- bind(contextKey, group) {
159
- return this.delegate.bind(contextKey, group);
160
- }
161
- get activePart() {
162
- return this.delegate.activePart;
163
- }
164
- };
165
- MonacoEditorParts = __decorate([
166
- ( __param(0, IInstantiationService))
167
- ], MonacoEditorParts);
168
- let transformInitializationState = (state) => state;
169
- onRenderWorkbench(async (accessor) => {
170
- const paneCompositePartService = accessor.get(IPaneCompositePartService);
171
- const viewDescriptorService = accessor.get(IViewDescriptorService);
172
- const lifecycleService = accessor.get(ILifecycleService);
173
- const storageService = accessor.get(IStorageService);
174
- const editorGroupService = accessor.get(IEditorGroupsService);
175
- const editorService = accessor.get(IEditorService);
176
- const logService = accessor.get(ILogService);
177
- const extensionService = accessor.get(IExtensionService);
178
- const environmentService = accessor.get(IEnvironmentService);
179
- const contextService = accessor.get(IWorkspaceContextService);
180
- const configurationService = accessor.get(IConfigurationService);
181
- const fileService = accessor.get(IFileService);
182
- const workingCopyBackupService = accessor.get(IWorkingCopyBackupService);
183
- const layoutService = accessor.get(ILayoutService);
184
- function getInitialEditorsState() {
185
- const defaultLayout = environmentService.options?.defaultLayout;
186
- if (((defaultLayout?.editors != null && defaultLayout.editors.length > 0) ||
187
- defaultLayout?.layout?.editors != null) &&
188
- ((defaultLayout.force ?? false) || storageService.isNew(1 ))) {
189
- return {
190
- layout: defaultLayout.layout?.editors,
191
- filesToOpenOrCreate: defaultLayout.editors?.map((editor) => {
192
- return {
193
- viewColumn: editor.viewColumn,
194
- fileUri: URI.revive(editor.uri),
195
- openOnlyIfExists: editor.openOnlyIfExists,
196
- options: editor.options
197
- };
198
- })
199
- };
200
- }
201
- const { filesToOpenOrCreate, filesToDiff, filesToMerge } = environmentService;
202
- if (filesToOpenOrCreate != null || filesToDiff != null || filesToMerge != null) {
203
- return { filesToOpenOrCreate, filesToDiff, filesToMerge };
204
- }
205
- return undefined;
206
- }
207
- function getDefaultLayoutViews(environmentService, storageService) {
208
- const defaultLayout = environmentService.options?.defaultLayout;
209
- if (defaultLayout == null) {
210
- return undefined;
211
- }
212
- if (!(defaultLayout.force ?? false) && !storageService.isNew(1 )) {
213
- return undefined;
214
- }
215
- const { views } = defaultLayout;
216
- if (views != null && views.length > 0) {
217
- return ( views.map((view) => view.id));
218
- }
219
- return undefined;
220
- }
221
- function shouldRestoreEditors(contextService, initialEditorsState) {
222
- if (isTemporaryWorkspace(contextService.getWorkspace())) {
223
- return false;
224
- }
225
- const forceRestoreEditors = configurationService.getValue('window.restoreWindows') === 'preserve';
226
- return !!forceRestoreEditors || initialEditorsState === undefined;
227
- }
228
- async function resolveEditorsToOpen(fileService, initialEditorsState) {
229
- if (initialEditorsState != null) {
230
- const filesToMerge = coalesce(await pathsToEditors(initialEditorsState.filesToMerge, fileService, logService));
231
- if (filesToMerge.length === 4 &&
232
- isResourceEditorInput(filesToMerge[0]) &&
233
- isResourceEditorInput(filesToMerge[1]) &&
234
- isResourceEditorInput(filesToMerge[2]) &&
235
- isResourceEditorInput(filesToMerge[3])) {
236
- return [
237
- {
238
- editor: {
239
- input1: { resource: filesToMerge[0].resource },
240
- input2: { resource: filesToMerge[1].resource },
241
- base: { resource: filesToMerge[2].resource },
242
- result: { resource: filesToMerge[3].resource },
243
- options: { pinned: true }
244
- }
245
- }
246
- ];
247
- }
248
- const filesToDiff = coalesce(await pathsToEditors(initialEditorsState.filesToDiff, fileService, logService));
249
- if (filesToDiff.length === 2) {
250
- return [
251
- {
252
- editor: {
253
- original: { resource: filesToDiff[0].resource },
254
- modified: { resource: filesToDiff[1].resource },
255
- options: { pinned: true }
256
- }
257
- }
258
- ];
259
- }
260
- const filesToOpenOrCreate = [];
261
- const resolvedFilesToOpenOrCreate = await pathsToEditors(initialEditorsState.filesToOpenOrCreate, fileService, logService);
262
- for (let i = 0; i < resolvedFilesToOpenOrCreate.length; i++) {
263
- const resolvedFileToOpenOrCreate = resolvedFilesToOpenOrCreate[i];
264
- if (resolvedFileToOpenOrCreate != null) {
265
- filesToOpenOrCreate.push({
266
- editor: resolvedFileToOpenOrCreate,
267
- viewColumn: initialEditorsState.filesToOpenOrCreate?.[i].viewColumn
268
- });
269
- }
270
- }
271
- return filesToOpenOrCreate;
272
- }
273
- else if (contextService.getWorkbenchState() === 1 &&
274
- configurationService.getValue('workbench.startupEditor') === 'newUntitledFile') {
275
- if (editorGroupService.mainPart.hasRestorableState) {
276
- return [];
277
- }
278
- const hasBackups = await workingCopyBackupService.hasBackups();
279
- if (hasBackups) {
280
- return [];
281
- }
282
- return [
283
- {
284
- editor: { resource: undefined }
285
- }
286
- ];
287
- }
288
- return [];
289
- }
290
- const initialEditorsState = getInitialEditorsState();
291
- if (initialEditorsState != null) {
292
- logService.info('Initial editor state', initialEditorsState);
293
- }
294
- let initialLayoutState = {
295
- layout: {
296
- editors: initialEditorsState?.layout
297
- },
298
- editor: {
299
- restoreEditors: shouldRestoreEditors(contextService, initialEditorsState),
300
- editorsToOpen: resolveEditorsToOpen(fileService, initialEditorsState)
301
- },
302
- views: {
303
- defaults: getDefaultLayoutViews(environmentService, storageService),
304
- containerToRestore: {}
305
- }
306
- };
307
- function getDefaultViewContainer(location) {
308
- return (viewDescriptorService.getDefaultViewContainer(location) ??
309
- viewDescriptorService.getViewContainersByLocation(location)[0]);
310
- }
311
- function initLayoutState() {
312
- if (layoutService.isVisible("workbench.parts.sidebar" )) {
313
- let viewContainerToRestore;
314
- if (!environmentService.isBuilt ||
315
- lifecycleService.startupKind === 3 ||
316
- isWeb) {
317
- viewContainerToRestore = storageService.get(SidebarPart.activeViewletSettingsKey, 1 , getDefaultViewContainer(0 )?.id);
318
- }
319
- else {
320
- viewContainerToRestore = getDefaultViewContainer(0 )?.id;
321
- }
322
- initialLayoutState.views.containerToRestore.sideBar = viewContainerToRestore;
323
- }
324
- if (layoutService.isVisible("workbench.parts.panel" )) {
325
- const viewContainerToRestore = storageService.get(PanelPart.activePanelSettingsKey, 1 , getDefaultViewContainer(1 )?.id);
326
- initialLayoutState.views.containerToRestore.panel = viewContainerToRestore;
327
- }
328
- if (layoutService.isVisible("workbench.parts.auxiliarybar" )) {
329
- const viewContainerToRestore = storageService.get(AuxiliaryBarPart.activePanelSettingsKey, 1 , getDefaultViewContainer(2 )?.id);
330
- initialLayoutState.views.containerToRestore.auxiliaryBar = viewContainerToRestore;
331
- }
332
- }
333
- initLayoutState();
334
- initialLayoutState = transformInitializationState(initialLayoutState);
335
- if (initialLayoutState.views.containerToRestore.sideBar == null) {
336
- layoutService.setPartHidden(true, "workbench.parts.sidebar" );
337
- }
338
- if (initialLayoutState.views.containerToRestore.panel == null) {
339
- layoutService.setPartHidden(true, "workbench.parts.panel" );
340
- }
341
- if (initialLayoutState.views.containerToRestore.auxiliaryBar == null) {
342
- layoutService.setPartHidden(true, "workbench.parts.auxiliarybar" );
343
- }
344
- const invisibleContainer = document.createElement('div');
345
- invisibleContainer.style.display = 'none';
346
- document.body.append(invisibleContainer);
347
- for (const { id, role, classes, options, getPosition, onDidChangePosition } of [
348
- { id: "workbench.parts.titlebar" , role: 'none', classes: ['titlebar'] },
349
- { id: "workbench.parts.banner" , role: 'banner', classes: ['banner'] },
350
- {
351
- id: "workbench.parts.activitybar" ,
352
- role: 'none',
353
- classes: ['activitybar'],
354
- getPosition: () => layoutService.getSideBarPosition(),
355
- onDidChangePosition: layoutService.onDidChangeSideBarPosition
356
- },
357
- {
358
- id: "workbench.parts.sidebar" ,
359
- role: 'none',
360
- classes: ['sidebar'],
361
- getPosition: () => layoutService.getSideBarPosition(),
362
- onDidChangePosition: layoutService.onDidChangeSideBarPosition
363
- },
364
- {
365
- id: "workbench.parts.editor" ,
366
- role: 'main',
367
- classes: ['editor'],
368
- options: { restorePreviousState: initialLayoutState.editor.restoreEditors }
369
- },
370
- {
371
- id: "workbench.parts.panel" ,
372
- role: 'none',
373
- classes: ['panel', 'basepanel'],
374
- getPosition: () => layoutService.getPanelPosition(),
375
- onDidChangePosition: layoutService.onDidChangePanelPosition
376
- },
377
- {
378
- id: "workbench.parts.auxiliarybar" ,
379
- role: 'none',
380
- classes: ['auxiliarybar', 'basepanel'],
381
- getPosition: () => layoutService.getSideBarPosition() === 0 ? 1 : 0 ,
382
- onDidChangePosition: layoutService.onDidChangeSideBarPosition
383
- },
384
- { id: "workbench.parts.statusbar" , role: 'status', classes: ['statusbar'] }
385
- ]) {
386
- const part = layoutService.getPart(id);
387
- if (part != null) {
388
- const partContainer = createPart(id, role, classes);
389
- part.create(partContainer, options);
390
- renderPart(partContainer, part);
391
- part.layout(9999, 9999, 0, 0);
392
- invisibleContainer.append(partContainer);
393
- if (getPosition != null) {
394
- let position = getPosition();
395
- part.element.classList.add(positionToString(position));
396
- onDidChangePosition?.(() => {
397
- part.element.classList.remove(positionToString(position));
398
- position = getPosition();
399
- part.element.classList.add(positionToString(position));
400
- });
401
- }
402
- }
403
- }
404
- const layoutReadyPromises = [];
405
- const layoutRestoredPromises = [];
406
- layoutReadyPromises.push((async () => {
407
- mark('code/willRestoreEditors');
408
- await editorGroupService.mainPart.whenReady;
409
- mark('code/restoreEditors/editorGroupsReady');
410
- if (initialLayoutState.layout?.editors != null) {
411
- editorGroupService.applyLayout(initialLayoutState.layout.editors);
412
- }
413
- const editors = await initialLayoutState.editor.editorsToOpen;
414
- mark('code/restoreEditors/editorsToOpenResolved');
415
- let openEditorsPromise;
416
- if (editors.length > 0) {
417
- const editorGroupsInVisualOrder = editorGroupService.getGroups(2 );
418
- const mapEditorsToGroup = new Map();
419
- for (const editor of editors) {
420
- const group = editorGroupsInVisualOrder[(editor.viewColumn ?? 1) - 1];
421
- let editorsByGroup = mapEditorsToGroup.get(group.id);
422
- if (editorsByGroup == null) {
423
- editorsByGroup = new Set();
424
- mapEditorsToGroup.set(group.id, editorsByGroup);
425
- }
426
- editorsByGroup.add(editor.editor);
427
- }
428
- openEditorsPromise = Promise.all(( Array.from(mapEditorsToGroup).map(async ([groupId, editors]) => {
429
- try {
430
- await editorService.openEditors(Array.from(editors), groupId, { validateTrust: true });
431
- }
432
- catch (error) {
433
- logService.error(error);
434
- }
435
- })));
436
- }
437
- layoutRestoredPromises.push(Promise.all([
438
- openEditorsPromise?.finally(() => mark('code/restoreEditors/editorsOpened')),
439
- editorGroupService.mainPart.whenRestored.finally(() => mark('code/restoreEditors/editorGroupsRestored'))
440
- ]).finally(() => {
441
- mark('code/didRestoreEditors');
442
- }));
443
- })());
444
- const restoreDefaultViewsPromise = (async () => {
445
- if (initialLayoutState.views.defaults != null && initialLayoutState.views.defaults.length > 0) {
446
- mark('code/willOpenDefaultViews');
447
- const locationsRestored = [];
448
- const tryOpenView = (view) => {
449
- const location = viewDescriptorService.getViewLocationById(view.id);
450
- if (location !== null) {
451
- const container = viewDescriptorService.getViewContainerByViewId(view.id);
452
- if (container != null) {
453
- if (view.order >= (locationsRestored[location]?.order ?? 0)) {
454
- locationsRestored[location] = { id: container.id, order: view.order };
455
- }
456
- const containerModel = viewDescriptorService.getViewContainerModel(container);
457
- containerModel.setCollapsed(view.id, false);
458
- containerModel.setVisible(view.id, true);
459
- return true;
460
- }
461
- }
462
- return false;
463
- };
464
- const defaultViews = ( [...initialLayoutState.views.defaults]
465
- .reverse()
466
- .map((v, index) => ({ id: v, order: index })));
467
- let i = defaultViews.length;
468
- while (i > 0) {
469
- i--;
470
- if (tryOpenView(defaultViews[i])) {
471
- defaultViews.splice(i, 1);
472
- }
473
- }
474
- if (defaultViews.length > 0) {
475
- await extensionService.whenInstalledExtensionsRegistered();
476
- let i = defaultViews.length;
477
- while (i > 0) {
478
- i--;
479
- if (tryOpenView(defaultViews[i])) {
480
- defaultViews.splice(i, 1);
481
- }
482
- }
483
- }
484
- if (locationsRestored[0 ] != null) {
485
- initialLayoutState.views.containerToRestore.sideBar =
486
- locationsRestored[0 ].id;
487
- }
488
- if (locationsRestored[1 ] != null) {
489
- initialLayoutState.views.containerToRestore.panel =
490
- locationsRestored[1 ].id;
491
- }
492
- if (locationsRestored[2 ] != null) {
493
- initialLayoutState.views.containerToRestore.auxiliaryBar =
494
- locationsRestored[2 ].id;
495
- }
496
- mark('code/didOpenDefaultViews');
497
- }
498
- })();
499
- layoutReadyPromises.push(restoreDefaultViewsPromise);
500
- layoutReadyPromises.push((async () => {
501
- await restoreDefaultViewsPromise;
502
- if (initialLayoutState.views.containerToRestore.sideBar == null) {
503
- return;
504
- }
505
- mark('code/willRestoreViewlet');
506
- const viewlet = await paneCompositePartService.openPaneComposite(initialLayoutState.views.containerToRestore.sideBar, 0 );
507
- if (viewlet == null) {
508
- await paneCompositePartService.openPaneComposite(getDefaultViewContainer(0 )?.id, 0 );
509
- }
510
- mark('code/didRestoreViewlet');
511
- })());
512
- layoutReadyPromises.push((async () => {
513
- await restoreDefaultViewsPromise;
514
- if (initialLayoutState.views.containerToRestore.panel == null) {
515
- return;
516
- }
517
- mark('code/willRestorePanel');
518
- const panel = await paneCompositePartService.openPaneComposite(initialLayoutState.views.containerToRestore.panel, 1 );
519
- if (panel == null) {
520
- await paneCompositePartService.openPaneComposite(getDefaultViewContainer(1 )?.id, 1 );
521
- }
522
- mark('code/didRestorePanel');
523
- })());
524
- layoutReadyPromises.push((async () => {
525
- await restoreDefaultViewsPromise;
526
- if (initialLayoutState.views.containerToRestore.auxiliaryBar == null) {
527
- return;
528
- }
529
- mark('code/willRestoreAuxiliaryBar');
530
- const panel = await paneCompositePartService.openPaneComposite(initialLayoutState.views.containerToRestore.auxiliaryBar, 2 );
531
- if (panel == null) {
532
- await paneCompositePartService.openPaneComposite(getDefaultViewContainer(2 )?.id, 2 );
533
- }
534
- mark('code/didRestoreAuxiliaryBar');
535
- })());
536
- await Promises.settled(layoutReadyPromises);
537
- await Promises.settled(layoutRestoredPromises);
538
- });
539
- function getServiceOverride(openEditorFallback, _webviewIframeAlternateDomains, initializationStateOrRestoreEditors) {
540
- if (initializationStateOrRestoreEditors != null) {
541
- transformInitializationState =
542
- typeof initializationStateOrRestoreEditors === 'boolean'
543
- ? (state) => ({
544
- ...state,
545
- editor: {
546
- ...state.editor,
547
- restoreEditors: initializationStateOrRestoreEditors
548
- }
549
- })
550
- : initializationStateOrRestoreEditors;
551
- }
552
- return {
553
- ...getServiceOverride$1(_webviewIframeAlternateDomains),
554
- ...getServiceOverride$2({
555
- isKeybindingConfigurationVisible: isEditorPartVisible,
556
- shouldUseGlobalPicker: isEditorPartVisible
557
- }),
558
- ...getServiceOverride$3({
559
- shouldUseGlobalKeybindings: isEditorPartVisible
560
- }),
561
- [( IEditorGroupsService.toString())]: new SyncDescriptor(MonacoEditorParts, [], false),
562
- [( IEditorService.toString())]: new SyncDescriptor(MonacoEditorService, [openEditorFallback, isEditorPartVisible], false)
563
- };
564
- }
565
-
566
- export { attachPart, getServiceOverride as default, isEditorPartVisible, onPartVisibilityChange, renderActivitybarPar, renderAuxiliaryPart, renderEditorPart, renderPanelPart, renderPart, renderSidebarPart, renderStatusBarPart };