@@ -7,8 +7,8 @@ import * as path from 'path';
77import * as fs from 'fs' ;
88import * as cp from 'child_process' ;
99import * as vscode from 'vscode' ;
10-
1110import * as nls from 'vscode-nls' ;
11+
1212const localize = nls . loadMessageBundle ( ) ;
1313
1414type AutoDetect = 'on' | 'off' ;
@@ -60,6 +60,13 @@ function getOutputChannel(): vscode.OutputChannel {
6060 return _channel ;
6161}
6262
63+ function showError ( ) {
64+ vscode . window . showWarningMessage ( localize ( 'gulpTaskDetectError' , 'Problem finding gulp tasks. See the output for more information.' ) ,
65+ localize ( 'gulpShowOutput' , 'Go to output' ) ) . then ( ( ) => {
66+ _channel . show ( true ) ;
67+ } ) ;
68+ }
69+
6370interface GulpTaskDefinition extends vscode . TaskDefinition {
6471 task : string ;
6572 file ?: string ;
@@ -125,7 +132,7 @@ class FolderDetector {
125132 let { stdout, stderr } = await exec ( commandLine , { cwd : rootPath } ) ;
126133 if ( stderr && stderr . length > 0 ) {
127134 getOutputChannel ( ) . appendLine ( stderr ) ;
128- getOutputChannel ( ) . show ( true ) ;
135+ showError ( ) ;
129136 }
130137 let result : vscode . Task [ ] = [ ] ;
131138 if ( stdout ) {
@@ -159,7 +166,7 @@ class FolderDetector {
159166 channel . appendLine ( err . stdout ) ;
160167 }
161168 channel . appendLine ( localize ( 'execFailed' , 'Auto detecting gulp for folder {0} failed with error: {1}' , this . workspaceFolder . name , err . error ? err . error . toString ( ) : 'unknown' ) ) ;
162- channel . show ( true ) ;
169+ showError ( ) ;
163170 return emptyTasks ;
164171 }
165172 }
0 commit comments