From 2b04ebaa114086fa3e19f4558c82003fbd9beff0 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Tue, 30 Mar 2021 00:23:17 -0700 Subject: [PATCH] Remove unused static functions in grid (#120123) Detected with latest TS build --- src/vs/base/browser/ui/grid/grid.ts | 45 ----------------------------- 1 file changed, 45 deletions(-) diff --git a/src/vs/base/browser/ui/grid/grid.ts b/src/vs/base/browser/ui/grid/grid.ts index 22d8a75e912..75e139fc46f 100644 --- a/src/vs/base/browser/ui/grid/grid.ts +++ b/src/vs/base/browser/ui/grid/grid.ts @@ -521,51 +521,6 @@ export class SerializableGrid extends Grid { return { type: 'branch', data: node.children.map(c => SerializableGrid.serializeNode(c, orthogonal(orientation))), size }; } - private static deserializeNode(json: ISerializedNode, orientation: Orientation, box: Box, deserializer: IViewDeserializer): GridNode { - if (!json || typeof json !== 'object') { - throw new Error('Invalid JSON'); - } - - if (json.type === 'branch') { - if (!Array.isArray(json.data)) { - throw new Error('Invalid JSON: \'data\' property of branch must be an array.'); - } - - const children: GridNode[] = []; - let offset = 0; - - for (const child of json.data) { - if (typeof child.size !== 'number') { - throw new Error('Invalid JSON: \'size\' property of node must be a number.'); - } - - const childSize = child.type === 'leaf' && child.visible === false ? 0 : child.size; - const childBox: Box = orientation === Orientation.HORIZONTAL - ? { top: box.top, left: box.left + offset, width: childSize, height: box.height } - : { top: box.top + offset, left: box.left, width: box.width, height: childSize }; - - children.push(SerializableGrid.deserializeNode(child, orthogonal(orientation), childBox, deserializer)); - offset += childSize; - } - - return { children, box }; - - } else if (json.type === 'leaf') { - const view: T = deserializer.fromJSON(json.data); - return { view, box, cachedVisibleSize: json.visible === false ? json.size : undefined }; - } - - throw new Error('Invalid JSON: \'type\' property must be either \'branch\' or \'leaf\'.'); - } - - private static getFirstLeaf(node: GridNode): GridLeafNode { - if (!isGridBranchNode(node)) { - return node; - } - - return SerializableGrid.getFirstLeaf(node.children[0]); - } - static deserialize(json: ISerializedGrid, deserializer: IViewDeserializer, options: IGridOptions = {}): SerializableGrid { if (typeof json.orientation !== 'number') { throw new Error('Invalid JSON: \'orientation\' property must be a number.');