@@ -9,11 +9,13 @@ import { ClassNode } from "./classesNode";
99export class RootNode extends NodeBase {
1010 public readonly contextValue : string ;
1111 private readonly _category : string ;
12+ private readonly isCsp : boolean ;
1213
13- public constructor ( label : string , fullName : string , contextValue : string , category : string , options : NodeOptions ) {
14+ public constructor ( label : string , fullName : string , contextValue : string , category : string , options : NodeOptions , isCsp = false ) {
1415 super ( label , fullName , options ) ;
1516 this . contextValue = contextValue ;
1617 this . _category = category ;
18+ this . isCsp = isCsp ;
1719 }
1820
1921 public get category ( ) : string {
@@ -29,7 +31,7 @@ export class RootNode extends NodeBase {
2931 }
3032
3133 public async getChildren ( element ) : Promise < NodeBase [ ] > {
32- const path = this instanceof PackageNode ? this . fullName + "/" : "" ;
34+ const path = ( this instanceof PackageNode || this . isCsp ) ? this . fullName + "/" : "" ;
3335 return this . getItems ( path , this . _category ) ;
3436 }
3537
@@ -50,6 +52,12 @@ export class RootNode extends NodeBase {
5052 case "ALL" :
5153 spec = "*.cls,*.mac,*.int,*.inc" ;
5254 break ;
55+ case "CSP" :
56+ spec = "*" ;
57+ break ;
58+ case "OTHER" :
59+ spec = "*" ;
60+ break ;
5361 default :
5462 return ;
5563 }
@@ -72,7 +80,12 @@ export class RootNode extends NodeBase {
7280 } )
7381 . then ( data =>
7482 data . map ( el => {
75- const fullName = ( this instanceof PackageNode ? this . fullName + "." : "" ) + el . Name ;
83+ let fullName = el . Name ;
84+ if ( this instanceof PackageNode ) {
85+ fullName = this . fullName + "." + el . Name ;
86+ } else if ( this . isCsp ) {
87+ fullName = this . fullName + "/" + el . Name ;
88+ }
7689 return {
7790 ...el ,
7891 fullName,
@@ -84,6 +97,15 @@ export class RootNode extends NodeBase {
8497 public getItems ( path : string , category : string ) : Promise < NodeBase [ ] > {
8598 return this . getList ( path , category , false ) . then ( data =>
8699 data
100+ . filter ( el => {
101+ if ( category === "OTHER" ) {
102+ return el . Type === "100" ;
103+ } else if ( category === "CSP" ) {
104+ return el . Type === "10" || el . Type === "5"
105+ } else {
106+ return true ;
107+ }
108+ } )
87109 . map ( el => {
88110 switch ( el . Type ) {
89111 case "9" :
@@ -94,6 +116,12 @@ export class RootNode extends NodeBase {
94116 case "1" :
95117 case "2" :
96118 return new RoutineNode ( el . Name , el . fullName , this . options ) ;
119+ case "100" :
120+ return new ClassNode ( el . Name , el . fullName , this . options ) ;
121+ case "10" :
122+ return new RootNode ( el . Name , el . fullName , this . contextValue , this . _category , this . options , true ) ;
123+ case "5" :
124+ return new ClassNode ( el . Name , el . fullName , this . options ) ;
97125 default :
98126 return null ;
99127 }
0 commit comments