From edd216eb0cdbe2509d1c035fa12342ebb60399fb Mon Sep 17 00:00:00 2001 From: Alex Ross Date: Fri, 14 Dec 2018 16:03:52 +0100 Subject: [PATCH] Gulp task detection shouldn't open output Fixes #64900 --- extensions/gulp/src/main.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/extensions/gulp/src/main.ts b/extensions/gulp/src/main.ts index b8612d511c2..07695ded365 100644 --- a/extensions/gulp/src/main.ts +++ b/extensions/gulp/src/main.ts @@ -7,8 +7,8 @@ import * as path from 'path'; import * as fs from 'fs'; import * as cp from 'child_process'; import * as vscode from 'vscode'; - import * as nls from 'vscode-nls'; + const localize = nls.loadMessageBundle(); type AutoDetect = 'on' | 'off'; @@ -60,6 +60,13 @@ function getOutputChannel(): vscode.OutputChannel { return _channel; } +function showError() { + vscode.window.showWarningMessage(localize('gulpTaskDetectError', 'Problem finding gulp tasks. See the output for more information.'), + localize('gulpShowOutput', 'Go to output')).then(() => { + _channel.show(true); + }); +} + interface GulpTaskDefinition extends vscode.TaskDefinition { task: string; file?: string; @@ -125,7 +132,7 @@ class FolderDetector { let { stdout, stderr } = await exec(commandLine, { cwd: rootPath }); if (stderr && stderr.length > 0) { getOutputChannel().appendLine(stderr); - getOutputChannel().show(true); + showError(); } let result: vscode.Task[] = []; if (stdout) { @@ -159,7 +166,7 @@ class FolderDetector { channel.appendLine(err.stdout); } channel.appendLine(localize('execFailed', 'Auto detecting gulp for folder {0} failed with error: {1}', this.workspaceFolder.name, err.error ? err.error.toString() : 'unknown')); - channel.show(true); + showError(); return emptyTasks; } }