From a71d9da0bf0ba26adfc19c0e0359fcd60e87d7d0 Mon Sep 17 00:00:00 2001 From: Mate Pek Date: Thu, 19 Oct 2023 12:27:50 +0700 Subject: [PATCH] output format change --- CHANGELOG.md | 6 ++++++ package.json | 2 +- src/TestResultBuilder.ts | 13 ++++++------- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae8283c7..76af75a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/package.json b/package.json index 92879c93..24efd414 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/TestResultBuilder.ts b/src/TestResultBuilder.ts index 051bbe9e..1e0e3777 100644 --- a/src/TestResultBuilder.ts +++ b/src/TestResultBuilder.ts @@ -90,17 +90,16 @@ export class TestResultBuilder { 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 ''; }