File tree 2 files changed +15
-8
lines changed
packages/vscode-js-profile-flame/src
2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,12 @@ export function activate(context: vscode.ExtensionContext) {
52
52
53
53
quickpick . title = 'Toggle visible performance charts' ;
54
54
quickpick . canSelectMany = true ;
55
- quickpick . items = metrics . map ( ( metric , i ) => ( {
56
- label : metric . name ( ) ,
57
- index : i ,
58
- } ) ) ;
55
+ quickpick . items = ( realtimeTracker . currentData ?. filter ( m => m . hasData ( ) ) ?? metrics ) . map (
56
+ ( metric , i ) => ( {
57
+ label : metric . name ( ) ,
58
+ index : i ,
59
+ } ) ,
60
+ ) ;
59
61
quickpick . selectedItems = settings . enabledMetrics . length
60
62
? settings . enabledMetrics . map ( index => quickpick . items [ index ] )
61
63
: quickpick . items . slice ( ) ;
@@ -69,11 +71,9 @@ export function activate(context: vscode.ExtensionContext) {
69
71
70
72
quickpick . dispose ( ) ;
71
73
72
- if ( ! chosen || ! chosen . length ) {
73
- return ;
74
+ if ( chosen ) {
75
+ realtimeTracker . setEnabledMetrics ( chosen ) ;
74
76
}
75
-
76
- realtimeTracker . setEnabledMetrics ( chosen ) ;
77
77
} ) ,
78
78
79
79
vscode . commands . registerCommand ( 'vscode-js-profile-flame.toggleSplitCharts' , ( ) => {
Original file line number Diff line number Diff line change @@ -55,6 +55,13 @@ export class RealtimeSessionTracker {
55
55
return [ ...this . webviews ] . filter ( w => w . visible ) ;
56
56
}
57
57
58
+ /**
59
+ * Gets currently displayed metric data.
60
+ */
61
+ public get currentData ( ) {
62
+ return this . displayedSession && this . sessionData . get ( this . displayedSession ) ?. metrics ;
63
+ }
64
+
58
65
constructor ( private readonly context : vscode . ExtensionContext ) { }
59
66
60
67
/**
You can’t perform that action at this time.
0 commit comments