@@ -68,25 +68,34 @@ async function loadChanges(files: CurrentFile[]): Promise<any> {
68
68
async function compile ( docs : CurrentFile [ ] , flags ?: string ) : Promise < any > {
69
69
flags = flags || config ( "compileFlags" ) ;
70
70
const api = new AtelierAPI ( docs [ 0 ] . uri ) ;
71
- return api
72
- . actionCompile ( docs . map ( el => el . name ) , flags )
73
- . then ( data => {
74
- const info = docs . length > 1 ? "" : `${ docs [ 0 ] . name } : ` ;
75
- if ( data . status && data . status . errors && data . status . errors . length ) {
76
- throw new Error ( `${ info } Compile error` ) ;
77
- } else if ( ! config ( "suppressCompileMessages" ) ) {
78
- vscode . window . showInformationMessage ( `${ info } Compilation succeeded` , "Hide" ) ;
79
- }
80
- return docs ;
81
- } )
82
- . catch ( ( error : Error ) => {
83
- outputChannel . appendLine ( error . message ) ;
84
- outputChannel . show ( true ) ;
85
- vscode . window . showErrorMessage ( error . message , "Show details" ) . then ( data => {
86
- outputChannel . show ( true ) ;
87
- } ) ;
88
- return [ ] ;
89
- } )
71
+ return vscode . window
72
+ . withProgress (
73
+ {
74
+ cancellable : false ,
75
+ location : vscode . ProgressLocation . Notification ,
76
+ title : `Compiling: ${ docs . length === 1 ? docs . map ( el => el . name ) . join ( ", " ) : docs . length + " files" } ` ,
77
+ } ,
78
+ ( ) =>
79
+ api
80
+ . actionCompile ( docs . map ( el => el . name ) , flags )
81
+ . then ( data => {
82
+ const info = docs . length > 1 ? "" : `${ docs [ 0 ] . name } : ` ;
83
+ if ( data . status && data . status . errors && data . status . errors . length ) {
84
+ throw new Error ( `${ info } Compile error` ) ;
85
+ } else if ( ! config ( "suppressCompileMessages" ) ) {
86
+ vscode . window . showInformationMessage ( `${ info } Compilation succeeded` , "Hide" ) ;
87
+ }
88
+ return docs ;
89
+ } )
90
+ . catch ( ( error : Error ) => {
91
+ outputChannel . appendLine ( error . message ) ;
92
+ outputChannel . show ( true ) ;
93
+ vscode . window . showErrorMessage ( error . message , "Show details" ) . then ( data => {
94
+ outputChannel . show ( true ) ;
95
+ } ) ;
96
+ return [ ] ;
97
+ } )
98
+ )
90
99
. then ( loadChanges ) ;
91
100
}
92
101
0 commit comments