44 * -------------------------------------------------------------------------------------------- */
55'use strict' ;
66
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' ;
815import { Control } from '../control' ;
916import { configuration } from '../util/config' ;
1017import { constants , Contexts } from '../util/constants' ;
@@ -21,7 +28,6 @@ const StatsViewInfo = {
2128 ViewName : 'Stats' ,
2229 Config : {
2330 AutoRefresh : 'views.stats.autoRefresh' ,
24- Enabled : 'views.stats.enabled' ,
2531 MaxAutoRefresh : 'views.maxAutoRefresh' ,
2632 } ,
2733 Context : Contexts . ViewsStatsEnabled ,
@@ -104,7 +110,7 @@ export class StatsView extends GView<StatsNode> {
104110 } else {
105111 void Control . setContext ( Contexts . ViewsStatsEnabled , false ) ;
106112
107- this . _children = [ ] ;
113+ this . _children = [ this . placeholder ( ) ] ;
108114 this . _onDidChangeTreeData . fire ( undefined ) ;
109115 }
110116 }
@@ -122,7 +128,7 @@ export class StatsView extends GView<StatsNode> {
122128 } else {
123129 void Control . setContext ( Contexts . ViewsStatsEnabled , false ) ;
124130
125- this . _children = [ ] ;
131+ this . _children = [ this . placeholder ( ) ] ;
126132 this . _onDidChangeTreeData . fire ( undefined ) ;
127133 }
128134 }
@@ -258,4 +264,18 @@ export class StatsView extends GView<StatsNode> {
258264 return false ;
259265 }
260266 }
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+ }
261281}
0 commit comments