Improve typescript task slash warning

Part of #74995
This commit is contained in:
Alex Ross
2019-07-30 12:23:31 +02:00
parent 49b51b32b2
commit 8fda22e123
2 changed files with 4 additions and 14 deletions

View File

@@ -73,10 +73,10 @@ class TscTaskProvider implements vscode.TaskProvider {
public resolveTask(_task: vscode.Task): vscode.Task | undefined {
const definition = <TypeScriptTaskDefinition>_task.definition;
const badTsconfig = '\\tsconfig.json';
if ((definition.tsconfig.length > badTsconfig.length) && (definition.tsconfig.substring(definition.tsconfig.length - badTsconfig.length, definition.tsconfig.length) === badTsconfig)) {
const badTsconfig = /\\tsconfig.*\.json/;
if (badTsconfig.exec(definition.tsconfig) !== null) {
// Warn that the task has the wrong slash type
vscode.window.showWarningMessage(localize('badTsConfig', "Typescript Task in tasks.json contains \"\\\\\". Typescript tasks must use \"/\""));
vscode.window.showWarningMessage(localize('badTsConfig', "Typescript Task in tasks.json contains \"\\\\\". Typescript tasks tsconfig must use \"/\""));
}
return undefined;
}