Skip to content

Commit

Permalink
Error Path will now have rootPath concatenated only once #79
Browse files Browse the repository at this point in the history
  • Loading branch information
riju91 committed Jan 9, 2018
1 parent 4854209 commit 1689fff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/execution/outputChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 1689fff

Please sign in to comment.