4
4
* -------------------------------------------------------------------------------------------- */
5
5
'use strict' ;
6
6
7
- import { commands , ConfigurationChangeEvent , TextDocumentChangeEvent , TreeItemCollapsibleState , window } from 'vscode' ;
7
+ import {
8
+ commands ,
9
+ ConfigurationChangeEvent ,
10
+ TextDocumentChangeEvent ,
11
+ ThemeIcon ,
12
+ TreeItemCollapsibleState ,
13
+ window ,
14
+ } from 'vscode' ;
8
15
import { Control } from '../control' ;
9
16
import { configuration } from '../util/config' ;
10
17
import { constants , Contexts } from '../util/constants' ;
@@ -21,7 +28,6 @@ const StatsViewInfo = {
21
28
ViewName : 'Stats' ,
22
29
Config : {
23
30
AutoRefresh : 'views.stats.autoRefresh' ,
24
- Enabled : 'views.stats.enabled' ,
25
31
MaxAutoRefresh : 'views.maxAutoRefresh' ,
26
32
} ,
27
33
Context : Contexts . ViewsStatsEnabled ,
@@ -104,7 +110,7 @@ export class StatsView extends GView<StatsNode> {
104
110
} else {
105
111
void Control . setContext ( Contexts . ViewsStatsEnabled , false ) ;
106
112
107
- this . _children = [ ] ;
113
+ this . _children = [ this . placeholder ( ) ] ;
108
114
this . _onDidChangeTreeData . fire ( undefined ) ;
109
115
}
110
116
}
@@ -122,7 +128,7 @@ export class StatsView extends GView<StatsNode> {
122
128
} else {
123
129
void Control . setContext ( Contexts . ViewsStatsEnabled , false ) ;
124
130
125
- this . _children = [ ] ;
131
+ this . _children = [ this . placeholder ( ) ] ;
126
132
this . _onDidChangeTreeData . fire ( undefined ) ;
127
133
}
128
134
}
@@ -258,4 +264,18 @@ export class StatsView extends GView<StatsNode> {
258
264
return false ;
259
265
}
260
266
}
267
+
268
+ private placeholder ( ) : StatsNode {
269
+ const ph = new StatsNode (
270
+ StatsType . Info ,
271
+ 'AutoRefresh is Disabled' ,
272
+ undefined ,
273
+ ResourceType . Stats ,
274
+ TreeItemCollapsibleState . None ,
275
+ ) ;
276
+
277
+ ph . iconPath = new ThemeIcon ( 'extensions-info-message' ) ;
278
+
279
+ return ph ;
280
+ }
261
281
}
0 commit comments