@@ -112,7 +112,7 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
112
112
getChildren ( element ?: MyTreeItem ) : MyTreeItem [ ] {
113
113
if ( element == null ) {
114
114
void this . possiblyShowUpdateTalonMessage ( ) ;
115
- return getSupportCategories ( ) ;
115
+ return getSupportCategories ( this . hasLegacyScopes ( ) ) ;
116
116
}
117
117
118
118
if ( element instanceof SupportCategoryTreeItem ) {
@@ -156,7 +156,15 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
156
156
}
157
157
}
158
158
159
- getScopeTypesWithSupport ( scopeSupport : ScopeSupport ) : ScopeSupportTreeItem [ ] {
159
+ private hasLegacyScopes ( ) : boolean {
160
+ return this . supportLevels . some (
161
+ ( supportLevel ) => supportLevel . support === ScopeSupport . supportedLegacy ,
162
+ ) ;
163
+ }
164
+
165
+ private getScopeTypesWithSupport (
166
+ scopeSupport : ScopeSupport ,
167
+ ) : ScopeSupportTreeItem [ ] {
160
168
return this . supportLevels
161
169
. filter (
162
170
( supportLevel ) =>
@@ -202,11 +210,15 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
202
210
}
203
211
}
204
212
205
- function getSupportCategories ( ) : SupportCategoryTreeItem [ ] {
213
+ function getSupportCategories (
214
+ includeLegacy : boolean ,
215
+ ) : SupportCategoryTreeItem [ ] {
206
216
return [
207
217
new SupportCategoryTreeItem ( ScopeSupport . supportedAndPresentInEditor ) ,
208
218
new SupportCategoryTreeItem ( ScopeSupport . supportedButNotPresentInEditor ) ,
209
- new SupportCategoryTreeItem ( ScopeSupport . supportedLegacy ) ,
219
+ ...( includeLegacy
220
+ ? [ new SupportCategoryTreeItem ( ScopeSupport . supportedLegacy ) ]
221
+ : [ ] ) ,
210
222
new SupportCategoryTreeItem ( ScopeSupport . unsupported ) ,
211
223
] ;
212
224
}
0 commit comments