@@ -200,26 +200,10 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
200
200
201
201
function getSupportCategories ( ) : SupportCategoryTreeItem [ ] {
202
202
return [
203
- new SupportCategoryTreeItem (
204
- "Present" ,
205
- ScopeSupport . supportedAndPresentInEditor ,
206
- TreeItemCollapsibleState . Expanded ,
207
- ) ,
208
- new SupportCategoryTreeItem (
209
- "Not present" ,
210
- ScopeSupport . supportedButNotPresentInEditor ,
211
- TreeItemCollapsibleState . Expanded ,
212
- ) ,
213
- new SupportCategoryTreeItem (
214
- "Legacy" ,
215
- ScopeSupport . supportedLegacy ,
216
- TreeItemCollapsibleState . Expanded ,
217
- ) ,
218
- new SupportCategoryTreeItem (
219
- "Unsupported" ,
220
- ScopeSupport . unsupported ,
221
- TreeItemCollapsibleState . Collapsed ,
222
- ) ,
203
+ new SupportCategoryTreeItem ( ScopeSupport . supportedAndPresentInEditor ) ,
204
+ new SupportCategoryTreeItem ( ScopeSupport . supportedButNotPresentInEditor ) ,
205
+ new SupportCategoryTreeItem ( ScopeSupport . supportedLegacy ) ,
206
+ new SupportCategoryTreeItem ( ScopeSupport . unsupported ) ,
223
207
] ;
224
208
}
225
209
@@ -283,12 +267,35 @@ class ScopeSupportTreeItem extends TreeItem {
283
267
}
284
268
285
269
class SupportCategoryTreeItem extends TreeItem {
286
- constructor (
287
- label : string ,
288
- public readonly scopeSupport : ScopeSupport ,
289
- collapsibleState : TreeItemCollapsibleState ,
290
- ) {
270
+ constructor ( public readonly scopeSupport : ScopeSupport ) {
271
+ let label : string ;
272
+ let description : string ;
273
+ let collapsibleState : TreeItemCollapsibleState ;
274
+ switch ( scopeSupport ) {
275
+ case ScopeSupport . supportedAndPresentInEditor :
276
+ label = "Present" ;
277
+ description = "in active editor" ;
278
+ collapsibleState = TreeItemCollapsibleState . Expanded ;
279
+ break ;
280
+ case ScopeSupport . supportedButNotPresentInEditor :
281
+ label = "Supported" ;
282
+ description = "but not present in active editor" ;
283
+ collapsibleState = TreeItemCollapsibleState . Expanded ;
284
+ break ;
285
+ case ScopeSupport . supportedLegacy :
286
+ label = "Legacy" ;
287
+ description = "may or may not be present in active editor" ;
288
+ collapsibleState = TreeItemCollapsibleState . Expanded ;
289
+ break ;
290
+ case ScopeSupport . unsupported :
291
+ label = "Unsupported" ;
292
+ description = "unsupported in language of active editor" ;
293
+ collapsibleState = TreeItemCollapsibleState . Collapsed ;
294
+ break ;
295
+ }
296
+
291
297
super ( label , collapsibleState ) ;
298
+ this . description = description ;
292
299
}
293
300
}
294
301
0 commit comments