@codingame/monaco-vscode-view-common-service-override 9.0.3 → 10.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/override/vs/workbench/browser/parts/editor/textEditor.weak.js +1 -1
- package/package.json +3 -3
- package/viewCommon.js +4 -1
- package/vscode/src/vs/base/browser/ui/centered/centeredViewLayout.js +1 -2
- package/vscode/src/vs/base/browser/ui/grid/grid.js +24 -34
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +34 -35
- package/vscode/src/vs/platform/actions/browser/actionViewItemService.js +38 -0
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +65 -65
- package/vscode/src/vs/workbench/browser/actions/listCommands.js +85 -85
- package/vscode/src/vs/workbench/browser/actions/navigationActions.js +74 -80
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +73 -69
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart.js +21 -24
- package/vscode/src/vs/workbench/browser/parts/compositeBar.js +77 -59
- package/vscode/src/vs/workbench/browser/parts/compositePart.js +9 -11
- package/vscode/src/vs/workbench/browser/parts/editor/auxiliaryEditorPart.js +3 -4
- package/vscode/src/vs/workbench/browser/parts/editor/editor.contribution.js +172 -173
- package/vscode/src/vs/workbench/browser/parts/editor/editorConfiguration.js +10 -10
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +16 -18
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +55 -61
- package/vscode/src/vs/workbench/browser/parts/editor/editorParts.js +19 -22
- package/vscode/src/vs/workbench/browser/parts/media/paneCompositePart.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/paneCompositeBar.js +76 -65
- package/vscode/src/vs/workbench/browser/parts/paneCompositePart.js +37 -18
- package/vscode/src/vs/workbench/browser/parts/paneCompositePartService.js +4 -5
- package/vscode/src/vs/workbench/browser/parts/panel/panelPart.js +20 -15
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarActions.js +6 -10
- package/vscode/src/vs/workbench/browser/parts/sidebar/sidebarPart.js +31 -45
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution.js +37 -40
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.js +18 -28
- package/vscode/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyTree.js +8 -8
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditor.contribution.js +2 -3
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditorInputFactory.js +1 -2
- package/vscode/src/vs/workbench/contrib/customEditor/browser/customEditors.js +1 -2
- package/vscode/src/vs/workbench/contrib/customEditor/common/contributedCustomEditors.js +3 -4
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditor.js +2 -8
- package/vscode/src/vs/workbench/contrib/customEditor/common/extensionPoint.js +14 -15
- package/vscode/src/vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution.js +0 -1
- package/vscode/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.js +21 -21
- package/vscode/src/vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution.js +9 -10
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/commands.js +28 -29
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/commands/devCommands.js +14 -14
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution.js +6 -7
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/colors.js +13 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editorGutter.js +4 -3
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/baseCodeEditorView.js +9 -7
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/codeEditorView.js +2 -2
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView.js +19 -19
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView.js +10 -9
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/mergeEditor.js +9 -13
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/scrollSynchronizer.js +26 -26
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewModel.js +6 -6
- package/vscode/src/vs/workbench/contrib/mergeEditor/browser/view/viewZones.js +2 -2
- package/vscode/src/vs/workbench/contrib/preferences/browser/keyboardLayoutPicker.js +16 -17
- package/vscode/src/vs/workbench/contrib/sash/browser/sash.contribution.js +3 -4
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution.js +33 -36
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyPeek.js +18 -28
- package/vscode/src/vs/workbench/contrib/typeHierarchy/browser/typeHierarchyTree.js +8 -8
- package/vscode/src/vs/workbench/contrib/webview/browser/resourceLoading.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +7 -8
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewCommands.js +13 -15
- package/vscode/src/vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution.js +3 -4
- package/vscode/src/vs/workbench/contrib/webviewView/browser/webviewViewPane.js +3 -4
- package/vscode/src/vs/workbench/services/activity/browser/activityService.js +0 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorPaneService.js +0 -1
- package/vscode/src/vs/workbench/services/editor/browser/editorResolverService.js +28 -30
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +71 -74
- package/vscode/src/vs/workbench/services/progress/browser/progressService.js +22 -26
- package/vscode/src/vs/workbench/services/untitled/common/untitledTextEditorService.js +0 -1
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +16 -18
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +9 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let AbstractTextEditor = class {};
|
|
2
2
|
class FakeAbstractTextEditor {
|
|
3
3
|
static [Symbol.hasInstance](instance) {
|
|
4
|
-
|
|
4
|
+
return AbstractTextEditor != null && instance instanceof AbstractTextEditor
|
|
5
5
|
}
|
|
6
6
|
}
|
|
7
7
|
function setAbstractTextEditor(_AbstractTextEditor) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-view-common-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"vscode": "npm:@codingame/monaco-vscode-api@
|
|
30
|
-
"@codingame/monaco-vscode-bulk-edit-service-override": "
|
|
29
|
+
"vscode": "npm:@codingame/monaco-vscode-api@10.0.0",
|
|
30
|
+
"@codingame/monaco-vscode-bulk-edit-service-override": "10.0.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/viewCommon.js
CHANGED
|
@@ -37,6 +37,8 @@ import { IEditorPaneService } from 'vscode/vscode/vs/workbench/services/editor/c
|
|
|
37
37
|
import { EditorPaneService } from './vscode/src/vs/workbench/services/editor/browser/editorPaneService.js';
|
|
38
38
|
import { CustomEditorLabelService } from 'vscode/vscode/vs/workbench/services/editor/common/customEditorLabelService';
|
|
39
39
|
import { ICustomEditorLabelService } from 'vscode/vscode/vs/workbench/services/editor/common/customEditorLabelService.service';
|
|
40
|
+
import { ActionViewItemService } from './vscode/src/vs/platform/actions/browser/actionViewItemService.js';
|
|
41
|
+
import { IActionViewItemService } from 'vscode/vscode/vs/platform/actions/browser/actionViewItemService.service';
|
|
40
42
|
import getServiceOverride$1 from '@codingame/monaco-vscode-bulk-edit-service-override';
|
|
41
43
|
import { changeUrlDomain } from './tools/url.js';
|
|
42
44
|
import { registerAssets } from 'vscode/assets';
|
|
@@ -95,7 +97,8 @@ function getServiceOverride(_webviewIframeAlternateDomains) {
|
|
|
95
97
|
[( IProgressService.toString())]: new SyncDescriptor(ProgressService, [], true),
|
|
96
98
|
[( IAuxiliaryWindowService.toString())]: new SyncDescriptor(BrowserAuxiliaryWindowService, [], true),
|
|
97
99
|
[( IEditorPaneService.toString())]: new SyncDescriptor(EditorPaneService, [], true),
|
|
98
|
-
[( ICustomEditorLabelService.toString())]: new SyncDescriptor(CustomEditorLabelService, [], true)
|
|
100
|
+
[( ICustomEditorLabelService.toString())]: new SyncDescriptor(CustomEditorLabelService, [], true),
|
|
101
|
+
[( IActionViewItemService.toString())]: new SyncDescriptor(ActionViewItemService, [], true)
|
|
99
102
|
};
|
|
100
103
|
}
|
|
101
104
|
|
|
@@ -2,7 +2,6 @@ import { $ } from 'vscode/vscode/vs/base/browser/dom';
|
|
|
2
2
|
import { SplitView } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
3
3
|
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
4
|
import { DisposableStore } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
6
5
|
|
|
7
6
|
const defaultState = {
|
|
8
7
|
targetWidth: 900,
|
|
@@ -126,7 +125,7 @@ class CenteredViewLayout {
|
|
|
126
125
|
this.view.element.remove();
|
|
127
126
|
this.splitView = ( new SplitView(this.container, {
|
|
128
127
|
inverseAltBehavior: true,
|
|
129
|
-
orientation:
|
|
128
|
+
orientation: 1 ,
|
|
130
129
|
styles: this.style
|
|
131
130
|
}));
|
|
132
131
|
this.splitView.orthogonalStartSash = this.boundarySashes.top;
|
|
@@ -1,25 +1,15 @@
|
|
|
1
|
-
import { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
2
|
-
export { Orientation } from 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
3
1
|
import { tail2, equals } from 'vscode/vscode/vs/base/common/arrays';
|
|
4
2
|
import { Disposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
3
|
import './gridview.css.js';
|
|
6
4
|
import { orthogonal, GridView } from './gridview.js';
|
|
7
5
|
import { Sizing as Sizing$1 } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
8
|
-
export { LayoutPriority } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
9
6
|
|
|
10
|
-
var Direction;
|
|
11
|
-
( (function(Direction) {
|
|
12
|
-
Direction[Direction["Up"] = 0] = "Up";
|
|
13
|
-
Direction[Direction["Down"] = 1] = "Down";
|
|
14
|
-
Direction[Direction["Left"] = 2] = "Left";
|
|
15
|
-
Direction[Direction["Right"] = 3] = "Right";
|
|
16
|
-
})(Direction || (Direction = {})));
|
|
17
7
|
function oppositeDirection(direction) {
|
|
18
8
|
switch (direction) {
|
|
19
|
-
case
|
|
20
|
-
case
|
|
21
|
-
case
|
|
22
|
-
case
|
|
9
|
+
case 0 : return 1 ;
|
|
10
|
+
case 1 : return 0 ;
|
|
11
|
+
case 2 : return 3 ;
|
|
12
|
+
case 3 : return 2 ;
|
|
23
13
|
}
|
|
24
14
|
}
|
|
25
15
|
function isGridBranchNode(node) {
|
|
@@ -40,13 +30,13 @@ function intersects(one, other) {
|
|
|
40
30
|
}
|
|
41
31
|
function getBoxBoundary(box, direction) {
|
|
42
32
|
const orientation = getDirectionOrientation(direction);
|
|
43
|
-
const offset = direction ===
|
|
44
|
-
direction ===
|
|
45
|
-
direction ===
|
|
33
|
+
const offset = direction === 0 ? box.top :
|
|
34
|
+
direction === 3 ? box.left + box.width :
|
|
35
|
+
direction === 1 ? box.top + box.height :
|
|
46
36
|
box.left;
|
|
47
37
|
const range = {
|
|
48
|
-
start: orientation ===
|
|
49
|
-
end: orientation ===
|
|
38
|
+
start: orientation === 1 ? box.top : box.left,
|
|
39
|
+
end: orientation === 1 ? box.top + box.height : box.left + box.width
|
|
50
40
|
};
|
|
51
41
|
return { offset, range };
|
|
52
42
|
}
|
|
@@ -72,20 +62,20 @@ function getLocationOrientation(rootOrientation, location) {
|
|
|
72
62
|
return location.length % 2 === 0 ? orthogonal(rootOrientation) : rootOrientation;
|
|
73
63
|
}
|
|
74
64
|
function getDirectionOrientation(direction) {
|
|
75
|
-
return direction ===
|
|
65
|
+
return direction === 0 || direction === 1 ? 0 : 1 ;
|
|
76
66
|
}
|
|
77
67
|
function getRelativeLocation(rootOrientation, location, direction) {
|
|
78
68
|
const orientation = getLocationOrientation(rootOrientation, location);
|
|
79
69
|
const directionOrientation = getDirectionOrientation(direction);
|
|
80
70
|
if (orientation === directionOrientation) {
|
|
81
71
|
let [rest, index] = tail2(location);
|
|
82
|
-
if (direction ===
|
|
72
|
+
if (direction === 3 || direction === 1 ) {
|
|
83
73
|
index += 1;
|
|
84
74
|
}
|
|
85
75
|
return [...rest, index];
|
|
86
76
|
}
|
|
87
77
|
else {
|
|
88
|
-
const index = (direction ===
|
|
78
|
+
const index = ((direction === 3 || direction === 1) ) ? 1 : 0;
|
|
89
79
|
return [...location, index];
|
|
90
80
|
}
|
|
91
81
|
}
|
|
@@ -254,7 +244,7 @@ class Grid extends Disposable {
|
|
|
254
244
|
const orientation = getLocationOrientation(this.gridview.orientation, sourceLocation);
|
|
255
245
|
const cachedViewSize = this.getViewCachedVisibleSize(view);
|
|
256
246
|
const sizing = typeof cachedViewSize === 'undefined'
|
|
257
|
-
? (orientation ===
|
|
247
|
+
? (orientation === 1 ? size.width : size.height)
|
|
258
248
|
: Sizing.Invisible(cachedViewSize);
|
|
259
249
|
this.removeView(view);
|
|
260
250
|
this.addViewAt(view, sizing, location);
|
|
@@ -328,16 +318,16 @@ class Grid extends Disposable {
|
|
|
328
318
|
const node = getGridNode(root, location);
|
|
329
319
|
let boundary = getBoxBoundary(node.box, direction);
|
|
330
320
|
if (wrap) {
|
|
331
|
-
if (direction ===
|
|
321
|
+
if (direction === 0 && node.box.top === 0) {
|
|
332
322
|
boundary = { offset: root.box.top + root.box.height, range: boundary.range };
|
|
333
323
|
}
|
|
334
|
-
else if (direction ===
|
|
324
|
+
else if (direction === 3 && node.box.left + node.box.width === root.box.width) {
|
|
335
325
|
boundary = { offset: 0, range: boundary.range };
|
|
336
326
|
}
|
|
337
|
-
else if (direction ===
|
|
327
|
+
else if (direction === 1 && node.box.top + node.box.height === root.box.height) {
|
|
338
328
|
boundary = { offset: 0, range: boundary.range };
|
|
339
329
|
}
|
|
340
|
-
else if (direction ===
|
|
330
|
+
else if (direction === 2 && node.box.left === 0) {
|
|
341
331
|
boundary = { offset: root.box.left + root.box.width, range: boundary.range };
|
|
342
332
|
}
|
|
343
333
|
}
|
|
@@ -358,11 +348,11 @@ class Grid extends Disposable {
|
|
|
358
348
|
return false;
|
|
359
349
|
}
|
|
360
350
|
const direction = getLocationOrientation(this.orientation, location);
|
|
361
|
-
const size = direction ===
|
|
351
|
+
const size = direction === 1 ? node.view.preferredWidth : node.view.preferredHeight;
|
|
362
352
|
if (typeof size !== 'number') {
|
|
363
353
|
return false;
|
|
364
354
|
}
|
|
365
|
-
const viewSize = direction ===
|
|
355
|
+
const viewSize = direction === 1 ? { width: Math.round(size) } : { height: Math.round(size) };
|
|
366
356
|
this.gridview.resizeView(location, viewSize);
|
|
367
357
|
return true;
|
|
368
358
|
};
|
|
@@ -382,7 +372,7 @@ class SerializableGrid extends Grid {
|
|
|
382
372
|
this.initialLayoutContext = true;
|
|
383
373
|
}
|
|
384
374
|
static serializeNode(node, orientation) {
|
|
385
|
-
const size = orientation ===
|
|
375
|
+
const size = orientation === 0 ? node.box.width : node.box.height;
|
|
386
376
|
if (!isGridBranchNode(node)) {
|
|
387
377
|
const serializedLeafNode = { type: 'leaf', data: node.view.toJSON(), size };
|
|
388
378
|
if (typeof node.cachedVisibleSize === 'number') {
|
|
@@ -472,7 +462,7 @@ function createSerializedNode(nodeDescriptor) {
|
|
|
472
462
|
function getDimensions(node, orientation) {
|
|
473
463
|
if (node.type === 'branch') {
|
|
474
464
|
const childrenDimensions = ( node.data.map(c => getDimensions(c, orthogonal(orientation))));
|
|
475
|
-
if (orientation ===
|
|
465
|
+
if (orientation === 0 ) {
|
|
476
466
|
const width = node.size || (childrenDimensions.length === 0 ? undefined : Math.max(...( childrenDimensions.map(d => d.width || 0))));
|
|
477
467
|
const height = childrenDimensions.length === 0 ? undefined : childrenDimensions.reduce((r, d) => r + (d.height || 0), 0);
|
|
478
468
|
return { width, height };
|
|
@@ -484,8 +474,8 @@ function getDimensions(node, orientation) {
|
|
|
484
474
|
}
|
|
485
475
|
}
|
|
486
476
|
else {
|
|
487
|
-
const width = orientation ===
|
|
488
|
-
const height = orientation ===
|
|
477
|
+
const width = orientation === 0 ? node.size : undefined;
|
|
478
|
+
const height = orientation === 0 ? undefined : node.size;
|
|
489
479
|
return { width, height };
|
|
490
480
|
}
|
|
491
481
|
}
|
|
@@ -501,4 +491,4 @@ function createSerializedGrid(gridDescriptor) {
|
|
|
501
491
|
};
|
|
502
492
|
}
|
|
503
493
|
|
|
504
|
-
export {
|
|
494
|
+
export { Grid, SerializableGrid, Sizing, createSerializedGrid, getRelativeLocation, isGridBranchNode, orthogonal, sanitizeGridNodeDescriptor };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { $ } from 'vscode/vscode/vs/base/browser/dom';
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import { LayoutPriority, SplitView, Sizing } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
5
|
-
export { LayoutPriority, Sizing } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
2
|
+
import { SplitView, Sizing } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
3
|
+
export { Sizing } from 'vscode/vscode/vs/base/browser/ui/splitview/splitview';
|
|
6
4
|
import { equals, tail2 } from 'vscode/vscode/vs/base/common/arrays';
|
|
7
5
|
import { Color } from 'vscode/vscode/vs/base/common/color';
|
|
8
6
|
import { Emitter, Event, Relay } from 'vscode/vscode/vs/base/common/event';
|
|
@@ -10,12 +8,13 @@ import { DisposableStore, Disposable, toDisposable } from 'vscode/vscode/vs/base
|
|
|
10
8
|
import { rot } from 'vscode/vscode/vs/base/common/numbers';
|
|
11
9
|
import { isUndefined } from 'vscode/vscode/vs/base/common/types';
|
|
12
10
|
import './gridview.css.js';
|
|
11
|
+
import 'vscode/vscode/vs/base/browser/ui/sash/sash';
|
|
13
12
|
|
|
14
13
|
const defaultStyles = {
|
|
15
14
|
separatorBorder: Color.transparent
|
|
16
15
|
};
|
|
17
16
|
function orthogonal(orientation) {
|
|
18
|
-
return orientation ===
|
|
17
|
+
return orientation === 0 ? 1 : 0 ;
|
|
19
18
|
}
|
|
20
19
|
class LayoutController {
|
|
21
20
|
constructor(isLayoutEnabled) {
|
|
@@ -23,7 +22,7 @@ class LayoutController {
|
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
function toAbsoluteBoundarySashes(sashes, orientation) {
|
|
26
|
-
if (orientation ===
|
|
25
|
+
if (orientation === 1 ) {
|
|
27
26
|
return { left: sashes.start, right: sashes.end, top: sashes.orthogonalStart, bottom: sashes.orthogonalEnd };
|
|
28
27
|
}
|
|
29
28
|
else {
|
|
@@ -31,7 +30,7 @@ function toAbsoluteBoundarySashes(sashes, orientation) {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
function fromAbsoluteBoundarySashes(sashes, orientation) {
|
|
34
|
-
if (orientation ===
|
|
33
|
+
if (orientation === 1 ) {
|
|
35
34
|
return { start: sashes.left, end: sashes.right, orthogonalStart: sashes.top, orthogonalEnd: sashes.bottom };
|
|
36
35
|
}
|
|
37
36
|
else {
|
|
@@ -51,16 +50,16 @@ class BranchNode {
|
|
|
51
50
|
get absoluteOrthogonalOffset() { return this._absoluteOrthogonalOffset; }
|
|
52
51
|
get styles() { return this._styles; }
|
|
53
52
|
get width() {
|
|
54
|
-
return this.orientation ===
|
|
53
|
+
return this.orientation === 1 ? this.size : this.orthogonalSize;
|
|
55
54
|
}
|
|
56
55
|
get height() {
|
|
57
|
-
return this.orientation ===
|
|
56
|
+
return this.orientation === 1 ? this.orthogonalSize : this.size;
|
|
58
57
|
}
|
|
59
58
|
get top() {
|
|
60
|
-
return this.orientation ===
|
|
59
|
+
return this.orientation === 1 ? this._absoluteOffset : this._absoluteOrthogonalOffset;
|
|
61
60
|
}
|
|
62
61
|
get left() {
|
|
63
|
-
return this.orientation ===
|
|
62
|
+
return this.orientation === 1 ? this._absoluteOrthogonalOffset : this._absoluteOffset;
|
|
64
63
|
}
|
|
65
64
|
get minimumSize() {
|
|
66
65
|
return this.children.length === 0 ? 0 : Math.max(...( this.children.map(
|
|
@@ -74,18 +73,18 @@ class BranchNode {
|
|
|
74
73
|
}
|
|
75
74
|
get priority() {
|
|
76
75
|
if (this.children.length === 0) {
|
|
77
|
-
return
|
|
76
|
+
return 0 ;
|
|
78
77
|
}
|
|
79
78
|
const priorities = ( this.children.map(
|
|
80
|
-
c => typeof c.priority === 'undefined' ?
|
|
79
|
+
c => typeof c.priority === 'undefined' ? 0 : c.priority
|
|
81
80
|
));
|
|
82
|
-
if (( priorities.some(p => p ===
|
|
83
|
-
return
|
|
81
|
+
if (( priorities.some(p => p === 2 ))) {
|
|
82
|
+
return 2 ;
|
|
84
83
|
}
|
|
85
|
-
else if (( priorities.some(p => p ===
|
|
86
|
-
return
|
|
84
|
+
else if (( priorities.some(p => p === 1 ))) {
|
|
85
|
+
return 1 ;
|
|
87
86
|
}
|
|
88
|
-
return
|
|
87
|
+
return 0 ;
|
|
89
88
|
}
|
|
90
89
|
get proportionalLayout() {
|
|
91
90
|
if (this.children.length === 0) {
|
|
@@ -100,16 +99,16 @@ class BranchNode {
|
|
|
100
99
|
return this.splitview.maximumSize;
|
|
101
100
|
}
|
|
102
101
|
get minimumWidth() {
|
|
103
|
-
return this.orientation ===
|
|
102
|
+
return this.orientation === 1 ? this.minimumOrthogonalSize : this.minimumSize;
|
|
104
103
|
}
|
|
105
104
|
get minimumHeight() {
|
|
106
|
-
return this.orientation ===
|
|
105
|
+
return this.orientation === 1 ? this.minimumSize : this.minimumOrthogonalSize;
|
|
107
106
|
}
|
|
108
107
|
get maximumWidth() {
|
|
109
|
-
return this.orientation ===
|
|
108
|
+
return this.orientation === 1 ? this.maximumOrthogonalSize : this.maximumSize;
|
|
110
109
|
}
|
|
111
110
|
get maximumHeight() {
|
|
112
|
-
return this.orientation ===
|
|
111
|
+
return this.orientation === 1 ? this.maximumSize : this.maximumOrthogonalSize;
|
|
113
112
|
}
|
|
114
113
|
get boundarySashes() { return this._boundarySashes; }
|
|
115
114
|
set boundarySashes(boundarySashes) {
|
|
@@ -382,7 +381,7 @@ class BranchNode {
|
|
|
382
381
|
if (!(otherFirstChild instanceof LeafNode) || !(otherSecondChild instanceof LeafNode)) {
|
|
383
382
|
return Disposable.None;
|
|
384
383
|
}
|
|
385
|
-
if (this.orientation ===
|
|
384
|
+
if (this.orientation === 0 ) {
|
|
386
385
|
secondChild.linkedWidthNode = otherFirstChild.linkedHeightNode = firstChild;
|
|
387
386
|
firstChild.linkedWidthNode = otherSecondChild.linkedHeightNode = secondChild;
|
|
388
387
|
otherSecondChild.linkedWidthNode = firstChild.linkedHeightNode = otherFirstChild;
|
|
@@ -474,22 +473,22 @@ class LeafNode {
|
|
|
474
473
|
const onDidChange = createLatchedOnDidChangeViewEvent(view);
|
|
475
474
|
this._onDidViewChange = ( Event.map(
|
|
476
475
|
onDidChange,
|
|
477
|
-
e => e && (this.orientation ===
|
|
476
|
+
e => e && (this.orientation === 0 ? e.width : e.height),
|
|
478
477
|
this.disposables
|
|
479
478
|
));
|
|
480
479
|
this.onDidChange = Event.any(this._onDidViewChange, this._onDidSetLinkedNode.event, this._onDidLinkedWidthNodeChange.event, this._onDidLinkedHeightNodeChange.event);
|
|
481
480
|
}
|
|
482
481
|
get width() {
|
|
483
|
-
return this.orientation ===
|
|
482
|
+
return this.orientation === 1 ? this.orthogonalSize : this.size;
|
|
484
483
|
}
|
|
485
484
|
get height() {
|
|
486
|
-
return this.orientation ===
|
|
485
|
+
return this.orientation === 1 ? this.size : this.orthogonalSize;
|
|
487
486
|
}
|
|
488
487
|
get top() {
|
|
489
|
-
return this.orientation ===
|
|
488
|
+
return this.orientation === 1 ? this.absoluteOffset : this.absoluteOrthogonalOffset;
|
|
490
489
|
}
|
|
491
490
|
get left() {
|
|
492
|
-
return this.orientation ===
|
|
491
|
+
return this.orientation === 1 ? this.absoluteOrthogonalOffset : this.absoluteOffset;
|
|
493
492
|
}
|
|
494
493
|
get element() {
|
|
495
494
|
return this.view.element;
|
|
@@ -507,10 +506,10 @@ class LeafNode {
|
|
|
507
506
|
return this.linkedHeightNode ? Math.min(this.linkedHeightNode.view.maximumHeight, this.view.maximumHeight) : this.view.maximumHeight;
|
|
508
507
|
}
|
|
509
508
|
get minimumSize() {
|
|
510
|
-
return this.orientation ===
|
|
509
|
+
return this.orientation === 1 ? this.minimumHeight : this.minimumWidth;
|
|
511
510
|
}
|
|
512
511
|
get maximumSize() {
|
|
513
|
-
return this.orientation ===
|
|
512
|
+
return this.orientation === 1 ? this.maximumHeight : this.maximumWidth;
|
|
514
513
|
}
|
|
515
514
|
get priority() {
|
|
516
515
|
return this.view.priority;
|
|
@@ -522,10 +521,10 @@ class LeafNode {
|
|
|
522
521
|
return this.view.snap;
|
|
523
522
|
}
|
|
524
523
|
get minimumOrthogonalSize() {
|
|
525
|
-
return this.orientation ===
|
|
524
|
+
return this.orientation === 1 ? this.minimumWidth : this.minimumHeight;
|
|
526
525
|
}
|
|
527
526
|
get maximumOrthogonalSize() {
|
|
528
|
-
return this.orientation ===
|
|
527
|
+
return this.orientation === 1 ? this.maximumWidth : this.maximumHeight;
|
|
529
528
|
}
|
|
530
529
|
get boundarySashes() { return this._boundarySashes; }
|
|
531
530
|
set boundarySashes(boundarySashes) {
|
|
@@ -653,7 +652,7 @@ class GridView {
|
|
|
653
652
|
this.proportionalLayout = typeof options.proportionalLayout !== 'undefined' ? !!options.proportionalLayout : true;
|
|
654
653
|
this.layoutController = ( new LayoutController(false));
|
|
655
654
|
this.root = ( new BranchNode(
|
|
656
|
-
|
|
655
|
+
0 ,
|
|
657
656
|
this.layoutController,
|
|
658
657
|
this.styles,
|
|
659
658
|
this.proportionalLayout
|
|
@@ -665,7 +664,7 @@ class GridView {
|
|
|
665
664
|
}
|
|
666
665
|
layout(width, height, top = 0, left = 0) {
|
|
667
666
|
this.layoutController.isLayoutEnabled = true;
|
|
668
|
-
const [size, orthogonalSize, offset, orthogonalOffset] = this.root.orientation ===
|
|
667
|
+
const [size, orthogonalSize, offset, orthogonalOffset] = this.root.orientation === 1 ? [height, width, top, left] : [width, height, left, top];
|
|
669
668
|
this.root.layout(size, 0, { orthogonalSize, absoluteOffset: offset, absoluteOrthogonalOffset: orthogonalOffset, absoluteSize: size, absoluteOrthogonalSize: orthogonalSize });
|
|
670
669
|
}
|
|
671
670
|
addView(view, size, location) {
|
|
@@ -846,7 +845,7 @@ class GridView {
|
|
|
846
845
|
if (!size.width && !size.height) {
|
|
847
846
|
return;
|
|
848
847
|
}
|
|
849
|
-
const [parentSize, grandParentSize] = parent.orientation ===
|
|
848
|
+
const [parentSize, grandParentSize] = parent.orientation === 1 ? [size.width, size.height] : [size.height, size.width];
|
|
850
849
|
if (typeof grandParentSize === 'number' && pathToParent.length > 0) {
|
|
851
850
|
const [, grandParent] = tail2(pathToParent);
|
|
852
851
|
const [, parentIndex] = tail2(rest);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Emitter } from 'vscode/vscode/vs/base/common/event';
|
|
2
|
+
import { toDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import 'vscode/vscode/vs/platform/instantiation/common/instantiation';
|
|
4
|
+
|
|
5
|
+
class ActionViewItemService {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._providers = ( new Map());
|
|
8
|
+
this._onDidChange = ( new Emitter());
|
|
9
|
+
this.onDidChange = this._onDidChange.event;
|
|
10
|
+
}
|
|
11
|
+
dispose() {
|
|
12
|
+
this._onDidChange.dispose();
|
|
13
|
+
}
|
|
14
|
+
register(menu, commandId, provider, event) {
|
|
15
|
+
const id = this._makeKey(menu, commandId);
|
|
16
|
+
if (( this._providers.has(id))) {
|
|
17
|
+
throw ( new Error(
|
|
18
|
+
`A provider for the command ${commandId} and menu ${menu} is already registered.`
|
|
19
|
+
));
|
|
20
|
+
}
|
|
21
|
+
this._providers.set(id, provider);
|
|
22
|
+
const listener = event?.(() => {
|
|
23
|
+
this._onDidChange.fire(menu);
|
|
24
|
+
});
|
|
25
|
+
return toDisposable(() => {
|
|
26
|
+
listener?.dispose();
|
|
27
|
+
this._providers.delete(id);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
lookUp(menu, commandId) {
|
|
31
|
+
return this._providers.get(this._makeKey(menu, commandId));
|
|
32
|
+
}
|
|
33
|
+
_makeKey(menu, commandId) {
|
|
34
|
+
return menu.id + commandId;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export { ActionViewItemService };
|