@@ -29,6 +29,9 @@ export class Status implements vscode.Disposable {
2929 // the build button
3030 private _buildButton : vscode . StatusBarItem ;
3131
32+ // the rebuild button
33+ private _rebuildButton : vscode . StatusBarItem ;
34+
3235 // the target button
3336 private _targetButton : vscode . StatusBarItem ;
3437
@@ -76,6 +79,7 @@ export class Status implements vscode.Disposable {
7679 let modeButtonText = this . _modeButton ? this . _modeButton . text : null ;
7780 let toolChainButtonText = this . _toolChainButton ? this . _toolChainButton . text : null ;
7881 let buildButtonText = this . _buildButton ? this . _buildButton . text : null ;
82+ let rebuildButtonText = this . _rebuildButton ? this . _rebuildButton . text : null ;
7983 let targetButtonText = this . _targetButton ? this . _targetButton . text : null ;
8084 let runButtonText = this . _runButton ? this . _runButton . text : null ;
8185 let debugButtonText = this . _debugButton ? this . _debugButton . text : null ;
@@ -88,6 +92,7 @@ export class Status implements vscode.Disposable {
8892 if ( this . _modeButton ) { this . _modeButton . hide ( ) ; this . _modeButton . dispose ( ) ; }
8993 if ( this . _toolChainButton ) { this . _toolChainButton . hide ( ) ; this . _toolChainButton . dispose ( ) ; }
9094 if ( this . _buildButton ) { this . _buildButton . hide ( ) ; this . _buildButton . dispose ( ) ; }
95+ if ( this . _rebuildButton ) { this . _rebuildButton . hide ( ) ; this . _rebuildButton . dispose ( ) ; }
9196 if ( this . _targetButton ) { this . _targetButton . hide ( ) ; this . _targetButton . dispose ( ) ; }
9297 if ( this . _runButton ) { this . _runButton . hide ( ) ; this . _runButton . dispose ( ) ; }
9398 if ( this . _debugButton ) { this . _debugButton . hide ( ) ; this . _debugButton . dispose ( ) ; }
@@ -149,6 +154,13 @@ export class Status implements vscode.Disposable {
149154 this . _buildButton . text = restore && buildButtonText ? buildButtonText : `$(xmake-build)` ;
150155 this . _buildButton . tooltip = "Build the given target" ;
151156
157+ // init rebuild button
158+ this . _rebuildButton = vscode . window . createStatusBarItem (
159+ "Xmake Rebuild" + idSuffix , alignment , 2450 ) ;
160+ this . _rebuildButton . command = 'xmake.onRebuild' ;
161+ this . _rebuildButton . text = restore && rebuildButtonText ? rebuildButtonText : `$(refresh)` ;
162+ this . _rebuildButton . tooltip = "Rebuild the given target" ;
163+
152164 // init target button
153165 this . _targetButton = vscode . window . createStatusBarItem (
154166 "Xmake Config: Target" + idSuffix , alignment , 2400 ) ;
@@ -177,6 +189,7 @@ export class Status implements vscode.Disposable {
177189 this . _archButton ,
178190 this . _modeButton ,
179191 this . _buildButton ,
192+ this . _rebuildButton ,
180193 this . _targetButton ,
181194 this . _runButton ,
182195 this . _debugButton ,
@@ -199,6 +212,7 @@ export class Status implements vscode.Disposable {
199212 this . _archButton ,
200213 this . _modeButton ,
201214 this . _buildButton ,
215+ this . _rebuildButton ,
202216 this . _targetButton ,
203217 this . _runButton ,
204218 this . _debugButton ,
@@ -221,6 +235,7 @@ export class Status implements vscode.Disposable {
221235 { item : this . _archButton , show : config . statusShowArch } ,
222236 { item : this . _modeButton , show : config . statusShowMode } ,
223237 { item : this . _buildButton , show : config . statusShowBuild } ,
238+ { item : this . _rebuildButton , show : config . statusShowRebuild } ,
224239 { item : this . _targetButton , show : config . statusShowTarget } ,
225240 { item : this . _runButton , show : config . statusShowRun } ,
226241 { item : this . _debugButton , show : config . statusShowDebug } ,
0 commit comments