From 1689fffd9508ef54573d7953aa48c2e52c4a9f9b Mon Sep 17 00:00:00 2001 From: Saakallya Biswas Date: Tue, 9 Jan 2018 12:19:03 +0530 Subject: [PATCH] Error Path will now have rootPath concatenated only once #79 --- src/execution/outputChannel.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/execution/outputChannel.ts b/src/execution/outputChannel.ts index 462c8d86..81214b0e 100644 --- a/src/execution/outputChannel.ts +++ b/src/execution/outputChannel.ts @@ -30,12 +30,16 @@ export class OutputChannel { public appendOutBuf(line: string) { let regexes: RegExp[] = [/Specification: /, /at Object.* \(/]; - for (var i = 0; i < regexes.length; i++) { - let matches = line.match(regexes[i]); - if (matches) { - line = line.replace(matches[0], matches[0] + vscode.workspace.rootPath + path.sep) + var lineArray = line.split("\n") + for (var j = 0; j < lineArray.length; j++) { + for (var i = 0; i < regexes.length; i++) { + let matches = lineArray[j].match(regexes[i]); + if (matches && !lineArray[j].includes(vscode.workspace.rootPath)) { + lineArray[j] = lineArray[j].replace(matches[0], matches[0] + vscode.workspace.rootPath + path.sep) + } } } + line = lineArray.join("\n") this.outBuf.append(line); }