@@ -60,7 +60,7 @@ export class ToolchainNode extends BaseNode {
60
60
public readonly backend : string ,
61
61
public readonly toolchain : Toolchain
62
62
) {
63
- super ( label , vscode . TreeItemCollapsibleState . None ) ;
63
+ super ( label , vscode . TreeItemCollapsibleState . Expanded ) ;
64
64
if ( DefaultToolchain . getInstance ( ) . isEqual ( toolchain ) ) {
65
65
const backendThemeColor = new vscode . ThemeColor ( "charts.green" ) ;
66
66
this . iconPath = new vscode . ThemeIcon ( "layers" , backendThemeColor ) ;
@@ -80,6 +80,24 @@ export class ToolchainNode extends BaseNode {
80
80
}
81
81
}
82
82
83
+ export class CompilerNode extends BaseNode {
84
+ constructor ( ) {
85
+ super ( "compiler" , vscode . TreeItemCollapsibleState . None ) ;
86
+ const chartsThemeColor = new vscode . ThemeColor ( "charts.blue" ) ;
87
+ this . iconPath = new vscode . ThemeIcon ( "circuit-board" , chartsThemeColor ) ;
88
+ this . contextValue = "compiler" ;
89
+ }
90
+ }
91
+
92
+ export class SimulatorNode extends BaseNode {
93
+ constructor ( ) {
94
+ super ( "simulator" , vscode . TreeItemCollapsibleState . None ) ;
95
+ const chartsThemeColor = new vscode . ThemeColor ( "charts.blue" ) ;
96
+ this . iconPath = new vscode . ThemeIcon ( "inspect" , chartsThemeColor ) ;
97
+ this . contextValue = "simulator" ;
98
+ }
99
+ }
100
+
83
101
// NodeBuilder creates BackendNodes or ToolchainNodes
84
102
export class NodeBuilder {
85
103
static createBackendNodes ( ) : BackendNode [ ] {
@@ -112,6 +130,16 @@ export class NodeBuilder {
112
130
return tnode ;
113
131
} ) ;
114
132
}
133
+
134
+ static createChildNodes ( bnode : BaseNode ) : BaseNode [ ] {
135
+ if ( bnode instanceof ToolchainNode === false ) {
136
+ return [ ] ;
137
+ }
138
+
139
+ const cnode = new CompilerNode ( ) ;
140
+ const snode = new SimulatorNode ( ) ;
141
+ return [ cnode , snode ] ;
142
+ }
115
143
}
116
144
117
145
// ToolchainProvider provides TreeData
@@ -168,8 +196,10 @@ export class ToolchainProvider implements vscode.TreeDataProvider<BaseNode> {
168
196
public getChildren ( element ?: BaseNode ) : Thenable < BaseNode [ ] > {
169
197
if ( element === undefined ) {
170
198
return Promise . resolve ( NodeBuilder . createBackendNodes ( ) ) ;
171
- } else {
199
+ } else if ( element instanceof BackendNode === true ) {
172
200
return Promise . resolve ( NodeBuilder . createToolchainNodes ( element ) ) ;
201
+ } else {
202
+ return Promise . resolve ( NodeBuilder . createChildNodes ( element ) ) ;
173
203
}
174
204
}
175
205
0 commit comments