2
2
* Copyright (C) Microsoft Corporation. All rights reserved.
3
3
*--------------------------------------------------------*/
4
4
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 ' ;
7
7
import {
8
- useMemo ,
9
8
useCallback ,
10
9
useContext ,
11
- useState ,
10
+ useEffect ,
12
11
useLayoutEffect ,
12
+ useMemo ,
13
13
useRef ,
14
- useEffect ,
14
+ useState ,
15
15
} 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' ;
21
16
import * as ChevronDown from 'vscode-codicons/src/icons/chevron-down.svg' ;
22
17
import * as ChevronRight from 'vscode-codicons/src/icons/chevron-right.svg' ;
18
+ import { addToSet , removeFromSet , toggleInSet } from 'vscode-js-profile-core/out/esm/array' ;
23
19
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' ;
26
27
27
28
type SortFn = ( node : ILocation ) => number ;
28
29
@@ -197,9 +198,10 @@ const TimeViewHeader: FunctionComponent<{
197
198
id = "self-time-header"
198
199
className = { classes ( styles . heading , styles . timing ) }
199
200
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
+ ) }
203
205
>
204
206
{ sortFn === selfTime && < Icon i = { ChevronDown } /> }
205
207
Self Time
@@ -208,9 +210,10 @@ const TimeViewHeader: FunctionComponent<{
208
210
id = "total-time-header"
209
211
className = { classes ( styles . heading , styles . timing ) }
210
212
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
+ ) }
214
217
>
215
218
{ sortFn === aggTime && < Icon i = { ChevronDown } /> }
216
219
Total Time
@@ -268,7 +271,7 @@ const TimeViewRow: FunctionComponent<{
268
271
root = root . parent ;
269
272
}
270
273
271
- const location = getLocationText ( node ) ;
274
+ const location = getNodeText ( node ) ;
272
275
const expand = (
273
276
< span className = { styles . expander } >
274
277
{ node . childrenSize > 0 ? < Icon i = { expanded . has ( node ) ? ChevronDown : ChevronRight } /> : null }
0 commit comments