Skip to content

Commit

Permalink
output format change
Browse files Browse the repository at this point in the history
  • Loading branch information
matepek committed Oct 19, 2023
1 parent 4cc0e1e commit a71d9da
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]

## [4.6.1]

### Changed

- using relative path at test output. users can use Cmd+click to navigate.

### Fixed

- issue preventing to cancel continuous runs: [link](https://github.com/matepek/vscode-catch2-test-adapter/issues/398)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"icon": "resources/icon.png",
"author": "Mate Pek",
"publisher": "matepek",
"version": "4.6.0",
"version": "4.6.1",
"license": "MIT",
"homepage": "https://github.com/matepek/vscode-catch2-test-adapter",
"repository": {
Expand Down
13 changes: 6 additions & 7 deletions src/TestResultBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,16 @@ export class TestResultBuilder<T extends AbstractTest = AbstractTest> {
return undefined;
}

static readonly relativeLocPrefix = ' @ ./';

getLocationAtStr(file: string | undefined, line: number | string | undefined, lineIsZeroBased: boolean): string {
if (file) {
let lineSuffix = '';
parseLine(line, l => (lineSuffix = `:${l + (lineIsZeroBased ? 1 : 0)}`));
// const wp = this.test.exec.shared.workspacePath + '/';
// if (file.startsWith(wp)) {
// return ansi.dim(TestResultBuilder.relativeLocPrefix) + ansi.dim(file.substring(wp.length) + lineSuffix);
// }
return ansi.dim(` @ ${file}${lineSuffix}`);
const wp = this.test.exec.shared.workspacePath + '/';
if (file.startsWith(wp)) {
return ansi.dim(' @ ./' + file.substring(wp.length) + lineSuffix);
} else {
return ansi.dim(` @ ${file}${lineSuffix}`);
}
}
return '';
}
Expand Down

0 comments on commit a71d9da

Please sign in to comment.