@@ -112,7 +112,7 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
112112 getChildren ( element ?: MyTreeItem ) : MyTreeItem [ ] {
113113 if ( element == null ) {
114114 void this . possiblyShowUpdateTalonMessage ( ) ;
115- return getSupportCategories ( ) ;
115+ return getSupportCategories ( this . hasLegacyScopes ( ) ) ;
116116 }
117117
118118 if ( element instanceof SupportCategoryTreeItem ) {
@@ -156,7 +156,15 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
156156 }
157157 }
158158
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 [ ] {
160168 return this . supportLevels
161169 . filter (
162170 ( supportLevel ) =>
@@ -202,11 +210,15 @@ export class ScopeTreeProvider implements TreeDataProvider<MyTreeItem> {
202210 }
203211}
204212
205- function getSupportCategories ( ) : SupportCategoryTreeItem [ ] {
213+ function getSupportCategories (
214+ includeLegacy : boolean ,
215+ ) : SupportCategoryTreeItem [ ] {
206216 return [
207217 new SupportCategoryTreeItem ( ScopeSupport . supportedAndPresentInEditor ) ,
208218 new SupportCategoryTreeItem ( ScopeSupport . supportedButNotPresentInEditor ) ,
209- new SupportCategoryTreeItem ( ScopeSupport . supportedLegacy ) ,
219+ ...( includeLegacy
220+ ? [ new SupportCategoryTreeItem ( ScopeSupport . supportedLegacy ) ]
221+ : [ ] ) ,
210222 new SupportCategoryTreeItem ( ScopeSupport . unsupported ) ,
211223 ] ;
212224}
0 commit comments