Skip to content

Commit

Permalink
Don't show the output panel in jake and grunt extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexr00 committed Dec 20, 2018
1 parent 58e6b8f commit 1386fba
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
10 changes: 8 additions & 2 deletions extensions/grunt/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ function getOutputChannel(): vscode.OutputChannel {
return _channel;
}

function showError() {
vscode.window.showWarningMessage(localize('gulpTaskDetectError', 'Problem finding jake tasks. See the output for more information.'),
localize('jakeShowOutput', 'Go to output')).then(() => {
getOutputChannel().show(true);
});
}
interface GruntTaskDefinition extends vscode.TaskDefinition {
task: string;
file?: string;
Expand Down Expand Up @@ -120,7 +126,7 @@ class FolderDetector {
let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
if (stderr) {
getOutputChannel().appendLine(stderr);
getOutputChannel().show(true);
showError();
}
let result: vscode.Task[] = [];
if (stdout) {
Expand Down Expand Up @@ -186,7 +192,7 @@ class FolderDetector {
channel.appendLine(err.stdout);
}
channel.appendLine(localize('execFailed', 'Auto detecting Grunt for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
channel.show(true);
showError();
return emptyTasks;
}
}
Expand Down
11 changes: 9 additions & 2 deletions extensions/jake/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ function getOutputChannel(): vscode.OutputChannel {
return _channel;
}

function showError() {
vscode.window.showWarningMessage(localize('gulpTaskDetectError', 'Problem finding jake tasks. See the output for more information.'),
localize('jakeShowOutput', 'Go to output')).then(() => {
getOutputChannel().show(true);
});
}

interface JakeTaskDefinition extends vscode.TaskDefinition {
task: string;
file?: string;
Expand Down Expand Up @@ -124,7 +131,7 @@ class FolderDetector {
let { stdout, stderr } = await exec(commandLine, { cwd: rootPath });
if (stderr) {
getOutputChannel().appendLine(stderr);
getOutputChannel().show(true);
showError();
}
let result: vscode.Task[] = [];
if (stdout) {
Expand Down Expand Up @@ -163,7 +170,7 @@ class FolderDetector {
channel.appendLine(err.stdout);
}
channel.appendLine(localize('execFailed', 'Auto detecting Jake for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown'));
channel.show(true);
showError();
return emptyTasks;
}
}
Expand Down

0 comments on commit 1386fba

Please sign in to comment.