@@ -9,9 +9,14 @@ import { prewalk, prefor } from './tree.js'
9
9
import { open } from '../util/opener'
10
10
import { remote } from 'electron'
11
11
12
- function namestring ( func , file , line ) {
12
+ function namestring ( func , file , line , classes ) {
13
13
if ( ! func && ! file ) { return "Program" }
14
- return ( func ? func + " at " : "" ) + file + ( line == - 1 ? "" : ":" + line )
14
+ return (
15
+ ( func ? func + " at " : "" ) +
16
+ file +
17
+ ( line === - 1 ? "" : ":" + line ) +
18
+ ( classes . length === 0 ? "" : " (" + classes . join ( ", " ) + ")" )
19
+ )
15
20
}
16
21
17
22
function process ( view , tree ) {
@@ -21,7 +26,7 @@ function process (view, tree) {
21
26
count,
22
27
classes,
23
28
children,
24
- onmouseover : ( ) => view . current = { func, location, line, count} ,
29
+ onmouseover : ( ) => view . current = { func, location, line, count, classes } ,
25
30
onmouseout : ( ) => view . current = null ,
26
31
onclick : ( ) => open ( path , line - 1 , { pending : true } )
27
32
} ) )
@@ -68,11 +73,11 @@ export class ProfileViewer {
68
73
< Button icon = 'file' alt = 'Save' disabled = { ! this . save } onclick = { ( ) => this . saveData ( ) } />
69
74
</ span >
70
75
if ( ! current ) return < span > { always } </ span >
71
- const { func, location, line, count} = current
76
+ const { func, location, line, count, classes } = current
72
77
return < span >
73
78
{ always }
74
79
< span className = 'inline-block' > < Badge > { count } </ Badge > </ span >
75
- < span style = 'vertical-align:middle' > { namestring ( func , location , line ) } </ span >
80
+ < span style = 'vertical-align:middle' > { namestring ( func , location , line , classes ) } </ span >
76
81
</ span >
77
82
}
78
83
0 commit comments