@codingame/monaco-vscode-views-service-override 9.0.3 → 10.0.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/package.json +5 -5
- package/tools/editor.js +60 -22
- package/tools/views.js +34 -19
- package/tools.js +4 -2
- package/views.js +84 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-views-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.1",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
30
|
-
"@codingame/monaco-vscode-quickaccess-service-override": "
|
|
31
|
-
"@codingame/monaco-vscode-keybindings-service-override": "
|
|
32
|
-
"@codingame/monaco-vscode-view-common-service-override": "
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.1",
|
|
30
|
+
"@codingame/monaco-vscode-quickaccess-service-override": "10.0.1",
|
|
31
|
+
"@codingame/monaco-vscode-keybindings-service-override": "10.0.1",
|
|
32
|
+
"@codingame/monaco-vscode-view-common-service-override": "10.0.1"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/tools/editor.js
CHANGED
|
@@ -103,7 +103,9 @@ class EmptyEditorGroup {
|
|
|
103
103
|
get element() {
|
|
104
104
|
return unsupported();
|
|
105
105
|
}
|
|
106
|
-
get scopedContextKeyService() {
|
|
106
|
+
get scopedContextKeyService() {
|
|
107
|
+
return StandaloneServices.get(IContextKeyService);
|
|
108
|
+
}
|
|
107
109
|
focus() {
|
|
108
110
|
}
|
|
109
111
|
}
|
|
@@ -126,17 +128,27 @@ class SimpleEditorPane {
|
|
|
126
128
|
this.getTitle = unsupported;
|
|
127
129
|
this.focus = unsupported;
|
|
128
130
|
}
|
|
129
|
-
get minimumWidth() {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
get
|
|
131
|
+
get minimumWidth() {
|
|
132
|
+
return DEFAULT_EDITOR_MIN_DIMENSIONS.width;
|
|
133
|
+
}
|
|
134
|
+
get maximumWidth() {
|
|
135
|
+
return DEFAULT_EDITOR_MAX_DIMENSIONS.width;
|
|
136
|
+
}
|
|
137
|
+
get minimumHeight() {
|
|
138
|
+
return DEFAULT_EDITOR_MIN_DIMENSIONS.height;
|
|
139
|
+
}
|
|
140
|
+
get maximumHeight() {
|
|
141
|
+
return DEFAULT_EDITOR_MAX_DIMENSIONS.height;
|
|
142
|
+
}
|
|
133
143
|
getControl() {
|
|
134
144
|
return this.editor;
|
|
135
145
|
}
|
|
136
146
|
}
|
|
137
147
|
function wrapOpenEditor(textModelService, defaultBehavior, fallbackBahavior) {
|
|
138
148
|
async function openEditor(editor, optionsOrPreferredGroup, preferredGroup) {
|
|
139
|
-
const options = isEditorInput(editor)
|
|
149
|
+
const options = isEditorInput(editor)
|
|
150
|
+
? optionsOrPreferredGroup
|
|
151
|
+
: editor.options;
|
|
140
152
|
if (isPreferredGroup(optionsOrPreferredGroup)) {
|
|
141
153
|
preferredGroup = optionsOrPreferredGroup;
|
|
142
154
|
}
|
|
@@ -146,9 +158,13 @@ function wrapOpenEditor(textModelService, defaultBehavior, fallbackBahavior) {
|
|
|
146
158
|
}
|
|
147
159
|
let modelEditor;
|
|
148
160
|
const codeEditors = StandaloneServices.get(ICodeEditorService).listCodeEditors();
|
|
149
|
-
modelEditor = codeEditors.find(editor => editor instanceof StandaloneEditor &&
|
|
161
|
+
modelEditor = codeEditors.find((editor) => editor instanceof StandaloneEditor &&
|
|
162
|
+
editor.getModel() != null &&
|
|
163
|
+
( editor.getModel().uri.toString()) === ( resource.toString()));
|
|
150
164
|
if (modelEditor == null) {
|
|
151
|
-
const defaultBehaviorResult = await defaultBehavior(
|
|
165
|
+
const defaultBehaviorResult = await defaultBehavior(
|
|
166
|
+
editor,
|
|
167
|
+
optionsOrPreferredGroup, preferredGroup);
|
|
152
168
|
if (defaultBehaviorResult != null) {
|
|
153
169
|
return defaultBehaviorResult;
|
|
154
170
|
}
|
|
@@ -284,14 +300,17 @@ let StandaloneEditorGroup = StandaloneEditorGroup_1 = class StandaloneEditorGrou
|
|
|
284
300
|
this.isLocked = true;
|
|
285
301
|
this.stickyCount = 0;
|
|
286
302
|
this.getEditors = () => this.editors;
|
|
287
|
-
this.findEditors = (resource) => this.pane != null && ( resource.toString()) === ( this.pane.input.resource.toString())
|
|
303
|
+
this.findEditors = (resource) => this.pane != null && ( resource.toString()) === ( this.pane.input.resource.toString())
|
|
304
|
+
? [this.pane.input]
|
|
305
|
+
: [];
|
|
288
306
|
this.getEditorByIndex = (index) => this.pane != null && index === 0 ? this.pane.input : undefined;
|
|
289
307
|
this.getIndexOfEditor = (editorInput) => this.pane != null && this.pane.input === editorInput ? 0 : -1;
|
|
290
308
|
this.openEditor = async (editor) => {
|
|
291
309
|
if (editor.isDisposed()) {
|
|
292
310
|
return undefined;
|
|
293
311
|
}
|
|
294
|
-
if (editor instanceof TextResourceEditorInput &&
|
|
312
|
+
if (editor instanceof TextResourceEditorInput &&
|
|
313
|
+
( editor.resource.toString()) === this.pane?.input.resource.toString()) {
|
|
295
314
|
this.focus();
|
|
296
315
|
return this.pane;
|
|
297
316
|
}
|
|
@@ -394,7 +413,9 @@ let StandaloneEditorGroup = StandaloneEditorGroup_1 = class StandaloneEditorGrou
|
|
|
394
413
|
onDidChange: Event.None
|
|
395
414
|
};
|
|
396
415
|
}
|
|
397
|
-
get titleHeight() {
|
|
416
|
+
get titleHeight() {
|
|
417
|
+
return unsupported();
|
|
418
|
+
}
|
|
398
419
|
setActive(isActive) {
|
|
399
420
|
this.active = isActive;
|
|
400
421
|
}
|
|
@@ -453,7 +474,8 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
453
474
|
return [...this.delegate.getGroups(order), ...this.additionalGroups];
|
|
454
475
|
};
|
|
455
476
|
this.getGroup = (identifier) => {
|
|
456
|
-
return this.delegate.getGroup(identifier) ??
|
|
477
|
+
return (this.delegate.getGroup(identifier) ??
|
|
478
|
+
this.additionalGroups.find((group) => group.id === identifier));
|
|
457
479
|
};
|
|
458
480
|
this.activateGroup = (...args) => {
|
|
459
481
|
return this.delegate.activateGroup(...args);
|
|
@@ -501,14 +523,18 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
501
523
|
if (editor instanceof StandaloneEditor) {
|
|
502
524
|
let timeout;
|
|
503
525
|
const updateActiveGroup = (editor) => {
|
|
504
|
-
const newActiveGroup = editor != null
|
|
526
|
+
const newActiveGroup = editor != null
|
|
527
|
+
? this.additionalGroups.find((group) => group.editor === editor)
|
|
528
|
+
: undefined;
|
|
505
529
|
if (this.activeGroupOverride !== newActiveGroup) {
|
|
506
530
|
this.activeGroupOverride = newActiveGroup;
|
|
507
531
|
this._onDidChangeActiveGroup.fire(this.activeGroup);
|
|
508
532
|
}
|
|
509
533
|
};
|
|
510
534
|
const removeActiveGroup = (editor) => {
|
|
511
|
-
if (!emptyDelegate &&
|
|
535
|
+
if (!emptyDelegate &&
|
|
536
|
+
this.activeGroupOverride ===
|
|
537
|
+
this.additionalGroups.find((group) => group.editor === editor)) {
|
|
512
538
|
updateActiveGroup(undefined);
|
|
513
539
|
}
|
|
514
540
|
};
|
|
@@ -542,14 +568,14 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
542
568
|
};
|
|
543
569
|
const handleCodeEditorRemoved = (editor) => {
|
|
544
570
|
if (editor instanceof StandaloneEditor) {
|
|
545
|
-
const removedGroup = this.additionalGroups.find(group => group.editor === editor);
|
|
571
|
+
const removedGroup = this.additionalGroups.find((group) => group.editor === editor);
|
|
546
572
|
if (removedGroup != null) {
|
|
547
573
|
removedGroup.dispose();
|
|
548
574
|
if (this.activeGroupOverride === removedGroup) {
|
|
549
575
|
this.activeGroupOverride = undefined;
|
|
550
576
|
this._onDidChangeActiveGroup.fire(this.activeGroup);
|
|
551
577
|
}
|
|
552
|
-
this.additionalGroups = this.additionalGroups.filter(group => group !== removedGroup);
|
|
578
|
+
this.additionalGroups = this.additionalGroups.filter((group) => group !== removedGroup);
|
|
553
579
|
this._onDidRemoveGroup.fire(removedGroup);
|
|
554
580
|
}
|
|
555
581
|
}
|
|
@@ -589,11 +615,15 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
589
615
|
get hasRestorableState() {
|
|
590
616
|
return this.delegate.hasRestorableState;
|
|
591
617
|
}
|
|
592
|
-
get parts() {
|
|
618
|
+
get parts() {
|
|
619
|
+
return this.delegate.parts;
|
|
620
|
+
}
|
|
593
621
|
createAuxiliaryEditorPart(options) {
|
|
594
622
|
return this.delegate.createAuxiliaryEditorPart(options);
|
|
595
623
|
}
|
|
596
|
-
get mainPart() {
|
|
624
|
+
get mainPart() {
|
|
625
|
+
return this.delegate.mainPart;
|
|
626
|
+
}
|
|
597
627
|
getPart(container) {
|
|
598
628
|
return this.delegate.getPart(container);
|
|
599
629
|
}
|
|
@@ -612,10 +642,18 @@ let MonacoDelegateEditorGroupsService = class MonacoDelegateEditorGroupsService
|
|
|
612
642
|
get activeGroup() {
|
|
613
643
|
return this.activeGroupOverride ?? this.delegate.activeGroup;
|
|
614
644
|
}
|
|
615
|
-
get sideGroup() {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
get
|
|
645
|
+
get sideGroup() {
|
|
646
|
+
return this.delegate.sideGroup;
|
|
647
|
+
}
|
|
648
|
+
get count() {
|
|
649
|
+
return this.delegate.count + this.additionalGroups.length;
|
|
650
|
+
}
|
|
651
|
+
get orientation() {
|
|
652
|
+
return this.delegate.orientation;
|
|
653
|
+
}
|
|
654
|
+
get partOptions() {
|
|
655
|
+
return this.delegate.partOptions;
|
|
656
|
+
}
|
|
619
657
|
};
|
|
620
658
|
MonacoDelegateEditorGroupsService = __decorate([
|
|
621
659
|
( __param(2, IInstantiationService))
|
package/tools/views.js
CHANGED
|
@@ -50,7 +50,10 @@ class SimpleEditorPane extends InjectedEditorPane {
|
|
|
50
50
|
this.container = this.initialize();
|
|
51
51
|
this.wrapper = document.createElement('div');
|
|
52
52
|
this.wrapper.append(this.container);
|
|
53
|
-
this.scrollbar = this._register(new DomScrollableElement(this.wrapper, {
|
|
53
|
+
this.scrollbar = this._register(new DomScrollableElement(this.wrapper, {
|
|
54
|
+
horizontal: 1 ,
|
|
55
|
+
vertical: 1
|
|
56
|
+
}));
|
|
54
57
|
parent.appendChild(this.scrollbar.getDomNode());
|
|
55
58
|
const observer = new ResizeObserver(() => {
|
|
56
59
|
assertIsDefined(this.scrollbar).scanDomNode();
|
|
@@ -158,7 +161,7 @@ class SimpleEditorInput extends EditorInput {
|
|
|
158
161
|
}
|
|
159
162
|
}
|
|
160
163
|
function registerEditorPane(typeId, name, ctor, inputCtors) {
|
|
161
|
-
return ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(ctor, typeId, name), ( inputCtors.map(ctor => new SyncDescriptor(ctor))));
|
|
164
|
+
return ( Registry.as(EditorExtensions.EditorPane)).registerEditorPane(EditorPaneDescriptor.create(ctor, typeId, name), ( inputCtors.map((ctor) => new SyncDescriptor(ctor))));
|
|
162
165
|
}
|
|
163
166
|
function registerEditor(globPattern, editorInfo, editorOptions, factory) {
|
|
164
167
|
return withReadyServices((servicesAccessor) => {
|
|
@@ -173,17 +176,22 @@ const viewContainerRegistry = ( Registry.as(Extensions.ViewContainersRegistry));
|
|
|
173
176
|
const viewRegistry = ( Registry.as(Extensions.ViewsRegistry));
|
|
174
177
|
function registerCustomView(options) {
|
|
175
178
|
const iconUrl = options.icon != null ? ( URI.parse(options.icon)) : undefined;
|
|
176
|
-
const viewContainer = options.viewContainer ??
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
179
|
+
const viewContainer = options.viewContainer ??
|
|
180
|
+
viewContainerRegistry.registerViewContainer({
|
|
181
|
+
id: options.id,
|
|
182
|
+
title: { value: options.name, original: options.name },
|
|
183
|
+
order: options.order,
|
|
184
|
+
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [
|
|
185
|
+
options.id,
|
|
186
|
+
{ mergeViewWithContainerWhenSingleView: true }
|
|
187
|
+
]),
|
|
188
|
+
hideIfEmpty: true,
|
|
189
|
+
icon: iconUrl
|
|
190
|
+
}, options.location, {
|
|
191
|
+
isDefault: options.default
|
|
192
|
+
});
|
|
193
|
+
const views = [
|
|
194
|
+
{
|
|
187
195
|
id: options.id,
|
|
188
196
|
name: {
|
|
189
197
|
value: options.name,
|
|
@@ -193,7 +201,10 @@ function registerCustomView(options) {
|
|
|
193
201
|
renderBody(container) {
|
|
194
202
|
super.renderBody(container);
|
|
195
203
|
this.wrapper = document.createElement('div');
|
|
196
|
-
this.scrollbar = this._register(new DomScrollableElement(this.wrapper, {
|
|
204
|
+
this.scrollbar = this._register(new DomScrollableElement(this.wrapper, {
|
|
205
|
+
horizontal: 1 ,
|
|
206
|
+
vertical: 1
|
|
207
|
+
}));
|
|
197
208
|
this.container = $('.view-pane-content');
|
|
198
209
|
this.container.style.display = 'flex';
|
|
199
210
|
this.container.style.alignItems = 'stretch';
|
|
@@ -211,7 +222,7 @@ function registerCustomView(options) {
|
|
|
211
222
|
});
|
|
212
223
|
}
|
|
213
224
|
getActionViewItem(action, actionOptions) {
|
|
214
|
-
const customAction = (options.actions ?? []).find(customAction => customAction.id === action.id);
|
|
225
|
+
const customAction = (options.actions ?? []).find((customAction) => customAction.id === action.id);
|
|
215
226
|
if (customAction?.render != null) {
|
|
216
227
|
return new (class extends BaseActionViewItem {
|
|
217
228
|
constructor() {
|
|
@@ -234,7 +245,8 @@ function registerCustomView(options) {
|
|
|
234
245
|
collapsed: options.collapsed ?? false,
|
|
235
246
|
order: options.order,
|
|
236
247
|
containerIcon: iconUrl
|
|
237
|
-
}
|
|
248
|
+
}
|
|
249
|
+
];
|
|
238
250
|
viewRegistry.registerViews(views, viewContainer);
|
|
239
251
|
const disposableCollection = new DisposableStore();
|
|
240
252
|
disposableCollection.add({
|
|
@@ -252,14 +264,17 @@ function registerCustomView(options) {
|
|
|
252
264
|
id: action.id,
|
|
253
265
|
title: { value: action.title, original: action.title },
|
|
254
266
|
category: Categories.View,
|
|
255
|
-
menu: [
|
|
267
|
+
menu: [
|
|
268
|
+
{
|
|
256
269
|
id: MenuId.ViewTitle,
|
|
257
270
|
when: ( ContextKeyExpr.equals('view', options.id)),
|
|
258
271
|
group: 'navigation',
|
|
259
272
|
order: action.order
|
|
260
|
-
},
|
|
273
|
+
},
|
|
274
|
+
{
|
|
261
275
|
id: MenuId.CommandPalette
|
|
262
|
-
}
|
|
276
|
+
}
|
|
277
|
+
],
|
|
263
278
|
tooltip: action.tooltip,
|
|
264
279
|
icon: action.icon != null ? Codicon[action.icon] : undefined
|
|
265
280
|
});
|
package/tools.js
CHANGED
|
@@ -18,7 +18,7 @@ function memoizedConstructor(ctor) {
|
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
20
|
async function sleep(duration) {
|
|
21
|
-
await new Promise(resolve => setTimeout(resolve, duration));
|
|
21
|
+
await new Promise((resolve) => setTimeout(resolve, duration));
|
|
22
22
|
}
|
|
23
23
|
function throttle(fct, merge, delay) {
|
|
24
24
|
let lastPromise = Promise.resolve();
|
|
@@ -26,7 +26,9 @@ function throttle(fct, merge, delay) {
|
|
|
26
26
|
return async (param) => {
|
|
27
27
|
if (toConsume == null) {
|
|
28
28
|
toConsume = param;
|
|
29
|
-
lastPromise = lastPromise
|
|
29
|
+
lastPromise = lastPromise
|
|
30
|
+
.then(async () => await sleep(delay))
|
|
31
|
+
.then(async () => {
|
|
30
32
|
const _toConsume = toConsume;
|
|
31
33
|
toConsume = null;
|
|
32
34
|
await fct(_toConsume);
|
package/views.js
CHANGED
|
@@ -151,8 +151,7 @@ let MonacoEditorParts = class MonacoEditorParts extends MonacoDelegateEditorGrou
|
|
|
151
151
|
getId() {
|
|
152
152
|
return 'standalone';
|
|
153
153
|
}
|
|
154
|
-
updateStyles() {
|
|
155
|
-
}
|
|
154
|
+
updateStyles() { }
|
|
156
155
|
registerPart(part) {
|
|
157
156
|
return this.delegate.registerPart(part);
|
|
158
157
|
}
|
|
@@ -166,7 +165,7 @@ let MonacoEditorParts = class MonacoEditorParts extends MonacoDelegateEditorGrou
|
|
|
166
165
|
MonacoEditorParts = __decorate([
|
|
167
166
|
( __param(0, IInstantiationService))
|
|
168
167
|
], MonacoEditorParts);
|
|
169
|
-
let transformInitializationState = state => state;
|
|
168
|
+
let transformInitializationState = (state) => state;
|
|
170
169
|
onRenderWorkbench(async (accessor) => {
|
|
171
170
|
const paneCompositePartService = accessor.get(IPaneCompositePartService);
|
|
172
171
|
const viewDescriptorService = accessor.get(IViewDescriptorService);
|
|
@@ -184,10 +183,12 @@ onRenderWorkbench(async (accessor) => {
|
|
|
184
183
|
const layoutService = accessor.get(ILayoutService);
|
|
185
184
|
function getInitialEditorsState() {
|
|
186
185
|
const defaultLayout = environmentService.options?.defaultLayout;
|
|
187
|
-
if (((defaultLayout?.editors != null && defaultLayout.editors.length > 0) ||
|
|
186
|
+
if (((defaultLayout?.editors != null && defaultLayout.editors.length > 0) ||
|
|
187
|
+
defaultLayout?.layout?.editors != null) &&
|
|
188
|
+
((defaultLayout.force ?? false) || storageService.isNew(1 ))) {
|
|
188
189
|
return {
|
|
189
190
|
layout: defaultLayout.layout?.editors,
|
|
190
|
-
filesToOpenOrCreate: defaultLayout.editors?.map(editor => {
|
|
191
|
+
filesToOpenOrCreate: defaultLayout.editors?.map((editor) => {
|
|
191
192
|
return {
|
|
192
193
|
viewColumn: editor.viewColumn,
|
|
193
194
|
fileUri: URI.revive(editor.uri),
|
|
@@ -213,7 +214,7 @@ onRenderWorkbench(async (accessor) => {
|
|
|
213
214
|
}
|
|
214
215
|
const { views } = defaultLayout;
|
|
215
216
|
if (views != null && views.length > 0) {
|
|
216
|
-
return ( views.map(view => view.id));
|
|
217
|
+
return ( views.map((view) => view.id));
|
|
217
218
|
}
|
|
218
219
|
return undefined;
|
|
219
220
|
}
|
|
@@ -227,8 +228,13 @@ onRenderWorkbench(async (accessor) => {
|
|
|
227
228
|
async function resolveEditorsToOpen(fileService, initialEditorsState) {
|
|
228
229
|
if (initialEditorsState != null) {
|
|
229
230
|
const filesToMerge = coalesce(await pathsToEditors(initialEditorsState.filesToMerge, fileService, logService));
|
|
230
|
-
if (filesToMerge.length === 4 &&
|
|
231
|
-
|
|
231
|
+
if (filesToMerge.length === 4 &&
|
|
232
|
+
isResourceEditorInput(filesToMerge[0]) &&
|
|
233
|
+
isResourceEditorInput(filesToMerge[1]) &&
|
|
234
|
+
isResourceEditorInput(filesToMerge[2]) &&
|
|
235
|
+
isResourceEditorInput(filesToMerge[3])) {
|
|
236
|
+
return [
|
|
237
|
+
{
|
|
232
238
|
editor: {
|
|
233
239
|
input1: { resource: filesToMerge[0].resource },
|
|
234
240
|
input2: { resource: filesToMerge[1].resource },
|
|
@@ -236,17 +242,20 @@ onRenderWorkbench(async (accessor) => {
|
|
|
236
242
|
result: { resource: filesToMerge[3].resource },
|
|
237
243
|
options: { pinned: true }
|
|
238
244
|
}
|
|
239
|
-
}
|
|
245
|
+
}
|
|
246
|
+
];
|
|
240
247
|
}
|
|
241
248
|
const filesToDiff = coalesce(await pathsToEditors(initialEditorsState.filesToDiff, fileService, logService));
|
|
242
249
|
if (filesToDiff.length === 2) {
|
|
243
|
-
return [
|
|
250
|
+
return [
|
|
251
|
+
{
|
|
244
252
|
editor: {
|
|
245
253
|
original: { resource: filesToDiff[0].resource },
|
|
246
254
|
modified: { resource: filesToDiff[1].resource },
|
|
247
255
|
options: { pinned: true }
|
|
248
256
|
}
|
|
249
|
-
}
|
|
257
|
+
}
|
|
258
|
+
];
|
|
250
259
|
}
|
|
251
260
|
const filesToOpenOrCreate = [];
|
|
252
261
|
const resolvedFilesToOpenOrCreate = await pathsToEditors(initialEditorsState.filesToOpenOrCreate, fileService, logService);
|
|
@@ -261,7 +270,8 @@ onRenderWorkbench(async (accessor) => {
|
|
|
261
270
|
}
|
|
262
271
|
return filesToOpenOrCreate;
|
|
263
272
|
}
|
|
264
|
-
else if (contextService.getWorkbenchState() === 1 &&
|
|
273
|
+
else if (contextService.getWorkbenchState() === 1 &&
|
|
274
|
+
configurationService.getValue('workbench.startupEditor') === 'newUntitledFile') {
|
|
265
275
|
if (editorGroupService.mainPart.hasRestorableState) {
|
|
266
276
|
return [];
|
|
267
277
|
}
|
|
@@ -269,9 +279,11 @@ onRenderWorkbench(async (accessor) => {
|
|
|
269
279
|
if (hasBackups) {
|
|
270
280
|
return [];
|
|
271
281
|
}
|
|
272
|
-
return [
|
|
282
|
+
return [
|
|
283
|
+
{
|
|
273
284
|
editor: { resource: undefined }
|
|
274
|
-
}
|
|
285
|
+
}
|
|
286
|
+
];
|
|
275
287
|
}
|
|
276
288
|
return [];
|
|
277
289
|
}
|
|
@@ -293,12 +305,15 @@ onRenderWorkbench(async (accessor) => {
|
|
|
293
305
|
}
|
|
294
306
|
};
|
|
295
307
|
function getDefaultViewContainer(location) {
|
|
296
|
-
return viewDescriptorService.getDefaultViewContainer(location) ??
|
|
308
|
+
return (viewDescriptorService.getDefaultViewContainer(location) ??
|
|
309
|
+
viewDescriptorService.getViewContainersByLocation(location)[0]);
|
|
297
310
|
}
|
|
298
311
|
function initLayoutState() {
|
|
299
312
|
if (layoutService.isVisible("workbench.parts.sidebar" )) {
|
|
300
313
|
let viewContainerToRestore;
|
|
301
|
-
if (!environmentService.isBuilt ||
|
|
314
|
+
if (!environmentService.isBuilt ||
|
|
315
|
+
lifecycleService.startupKind === 3 ||
|
|
316
|
+
isWeb) {
|
|
302
317
|
viewContainerToRestore = storageService.get(SidebarPart.activeViewletSettingsKey, 1 , getDefaultViewContainer(0 )?.id);
|
|
303
318
|
}
|
|
304
319
|
else {
|
|
@@ -332,11 +347,40 @@ onRenderWorkbench(async (accessor) => {
|
|
|
332
347
|
for (const { id, role, classes, options, getPosition, onDidChangePosition } of [
|
|
333
348
|
{ id: "workbench.parts.titlebar" , role: 'none', classes: ['titlebar'] },
|
|
334
349
|
{ id: "workbench.parts.banner" , role: 'banner', classes: ['banner'] },
|
|
335
|
-
{
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
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
|
+
},
|
|
340
384
|
{ id: "workbench.parts.statusbar" , role: 'status', classes: ['statusbar'] }
|
|
341
385
|
]) {
|
|
342
386
|
const part = layoutService.getPart(id);
|
|
@@ -417,7 +461,9 @@ onRenderWorkbench(async (accessor) => {
|
|
|
417
461
|
}
|
|
418
462
|
return false;
|
|
419
463
|
};
|
|
420
|
-
const defaultViews = ( [...initialLayoutState.views.defaults]
|
|
464
|
+
const defaultViews = ( [...initialLayoutState.views.defaults]
|
|
465
|
+
.reverse()
|
|
466
|
+
.map((v, index) => ({ id: v, order: index })));
|
|
421
467
|
let i = defaultViews.length;
|
|
422
468
|
while (i > 0) {
|
|
423
469
|
i--;
|
|
@@ -436,13 +482,16 @@ onRenderWorkbench(async (accessor) => {
|
|
|
436
482
|
}
|
|
437
483
|
}
|
|
438
484
|
if (locationsRestored[0 ] != null) {
|
|
439
|
-
initialLayoutState.views.containerToRestore.sideBar =
|
|
485
|
+
initialLayoutState.views.containerToRestore.sideBar =
|
|
486
|
+
locationsRestored[0 ].id;
|
|
440
487
|
}
|
|
441
488
|
if (locationsRestored[1 ] != null) {
|
|
442
|
-
initialLayoutState.views.containerToRestore.panel =
|
|
489
|
+
initialLayoutState.views.containerToRestore.panel =
|
|
490
|
+
locationsRestored[1 ].id;
|
|
443
491
|
}
|
|
444
492
|
if (locationsRestored[2 ] != null) {
|
|
445
|
-
initialLayoutState.views.containerToRestore.auxiliaryBar =
|
|
493
|
+
initialLayoutState.views.containerToRestore.auxiliaryBar =
|
|
494
|
+
locationsRestored[2 ].id;
|
|
446
495
|
}
|
|
447
496
|
mark('code/didOpenDefaultViews');
|
|
448
497
|
}
|
|
@@ -489,15 +538,16 @@ onRenderWorkbench(async (accessor) => {
|
|
|
489
538
|
});
|
|
490
539
|
function getServiceOverride(openEditorFallback, _webviewIframeAlternateDomains, initializationStateOrRestoreEditors) {
|
|
491
540
|
if (initializationStateOrRestoreEditors != null) {
|
|
492
|
-
transformInitializationState =
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
541
|
+
transformInitializationState =
|
|
542
|
+
typeof initializationStateOrRestoreEditors === 'boolean'
|
|
543
|
+
? (state) => ({
|
|
544
|
+
...state,
|
|
545
|
+
editor: {
|
|
546
|
+
...state.editor,
|
|
547
|
+
restoreEditors: initializationStateOrRestoreEditors
|
|
548
|
+
}
|
|
549
|
+
})
|
|
550
|
+
: initializationStateOrRestoreEditors;
|
|
501
551
|
}
|
|
502
552
|
return {
|
|
503
553
|
...getServiceOverride$1(_webviewIframeAlternateDomains),
|