Skip to content

Commit 73cd4bb

Browse files
committed
fix: vscode-js-profile-core import of notebook
1 parent 4c2ee98 commit 73cd4bb

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

packages/vscode-js-profile-notebook/src/client/table-view.tsx

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@
22
* Copyright (C) Microsoft Corporation. All rights reserved.
33
*--------------------------------------------------------*/
44

5-
import { h, FunctionComponent, Fragment } from 'preact';
6-
import styles from './table-view.css';
5+
import { Fragment, FunctionComponent, h } from 'preact';
6+
import VirtualList from 'preact-virtual-list';
77
import {
8-
useMemo,
98
useCallback,
109
useContext,
11-
useState,
10+
useEffect,
1211
useLayoutEffect,
12+
useMemo,
1313
useRef,
14-
useEffect,
14+
useState,
1515
} from 'preact/hooks';
16-
import { VsCodeApi } from 'vscode-js-profile-core/out/esm/client/vscodeApi';
17-
import { ILocation, IGraphNode } from 'vscode-js-profile-core/out/esm/cpu/model';
18-
import { classes } from 'vscode-js-profile-core/out/esm/client/util';
19-
import { IOpenDocumentMessage } from 'vscode-js-profile-core/out/esm/cpu/types';
20-
import { addToSet, removeFromSet, toggleInSet } from 'vscode-js-profile-core/out/esm/array';
2116
import * as ChevronDown from 'vscode-codicons/src/icons/chevron-down.svg';
2217
import * as ChevronRight from 'vscode-codicons/src/icons/chevron-right.svg';
18+
import { addToSet, removeFromSet, toggleInSet } from 'vscode-js-profile-core/out/esm/array';
2319
import { Icon } from 'vscode-js-profile-core/out/esm/client/icons';
24-
import VirtualList from 'preact-virtual-list';
25-
import { getLocationText, decimalFormat } from 'vscode-js-profile-core/out/esm/cpu/display';
20+
import { classes } from 'vscode-js-profile-core/out/esm/client/util';
21+
import { VsCodeApi } from 'vscode-js-profile-core/out/esm/client/vscodeApi';
22+
import { getNodeText } from 'vscode-js-profile-core/out/esm/common/display';
23+
import { IOpenDocumentMessage } from 'vscode-js-profile-core/out/esm/common/types';
24+
import { decimalFormat } from 'vscode-js-profile-core/out/esm/cpu/display';
25+
import { IGraphNode, ILocation } from 'vscode-js-profile-core/out/esm/cpu/model';
26+
import styles from './table-view.css';
2627

2728
type SortFn = (node: ILocation) => number;
2829

@@ -197,9 +198,10 @@ const TimeViewHeader: FunctionComponent<{
197198
id="self-time-header"
198199
className={classes(styles.heading, styles.timing)}
199200
aria-sort={sortFn === selfTime ? 'descending' : undefined}
200-
onClick={useCallback(() => onChangeSort(() => (sortFn === selfTime ? undefined : selfTime)), [
201-
sortFn,
202-
])}
201+
onClick={useCallback(
202+
() => onChangeSort(() => (sortFn === selfTime ? undefined : selfTime)),
203+
[sortFn],
204+
)}
203205
>
204206
{sortFn === selfTime && <Icon i={ChevronDown} />}
205207
Self Time
@@ -208,9 +210,10 @@ const TimeViewHeader: FunctionComponent<{
208210
id="total-time-header"
209211
className={classes(styles.heading, styles.timing)}
210212
aria-sort={sortFn === aggTime ? 'descending' : undefined}
211-
onClick={useCallback(() => onChangeSort(() => (sortFn === aggTime ? undefined : aggTime)), [
212-
sortFn,
213-
])}
213+
onClick={useCallback(
214+
() => onChangeSort(() => (sortFn === aggTime ? undefined : aggTime)),
215+
[sortFn],
216+
)}
214217
>
215218
{sortFn === aggTime && <Icon i={ChevronDown} />}
216219
Total Time
@@ -268,7 +271,7 @@ const TimeViewRow: FunctionComponent<{
268271
root = root.parent;
269272
}
270273

271-
const location = getLocationText(node);
274+
const location = getNodeText(node);
272275
const expand = (
273276
<span className={styles.expander}>
274277
{node.childrenSize > 0 ? <Icon i={expanded.has(node) ? ChevronDown : ChevronRight} /> : null}

0 commit comments

Comments
 (0)