Skip to content

Commit b084cc3

Browse files
feat: add name de-mangling for C++ symbols in the Test Explorer (#4340)
* feat: add name demangling for C++ symbols * docs: update CHANGELOG * chore: revert changes in yarn.lock as per CONTRIBUTING guide * updating yarn.lock --------- Co-authored-by: Garrett Campbell <[email protected]>
1 parent feedc96 commit b084cc3

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ Features:
1111

1212
Improvements:
1313

14+
- Add name de-mangling for C++ symbols in the Test Explorer view when running tests with coverage. [#4340](https://github.com/microsoft/vscode-cmake-tools/pull/4340) [@rjaegers](https://github.com/rjaegers)
1415
- No longer convert paths on lowercase on MacOS to enable cpp tools to resolve them. [#4325](https://github.com/microsoft/vscode-cmake-tools/pull/4325) [@tringenbach](https://github.com/tringenbach)
1516

1617
Bug Fixes:
1718

1819
- Fix bug that makes `Configure Task` lists only first folder in workspace. [#3232](https//github.com/microsoft/vscode-cmake-tools/issues/3232)
19-
- Fix displaying "Go to Test" in the Test Explorer when the DEF_SOURCE_LINE property is set, but there is no backtrace information present. [4321](https://github.com/microsoft/vscode-cmake-tools/pull/4321) [@rjaegers](https://github.com/rjaegers)
20+
- Fix displaying "Go to Test" in the Test Explorer when the DEF_SOURCE_LINE property is set, but there is no backtrace information present. [#4321](https://github.com/microsoft/vscode-cmake-tools/pull/4321) [@rjaegers](https://github.com/rjaegers)
2021
- Fix gnuld error parsing false positive on make errors, false negative due to trailing \r, and false parsing of new "multiple definitions" error [#2864](https://github.com/microsoft/vscode-cmake-tools/issues/2864) [@0xemgy](https://github.com/0xemgy)
2122
- Fixes for small bug string bugs. [#4319](https://github.com/microsoft/vscode-cmake-tools/issues/4319), [#4317](https://github.com/microsoft/vscode-cmake-tools/issues/4317), [#4312](https://github.com/microsoft/vscode-cmake-tools/issues/4312)
2223
- Fixes localization for "workspace is" string. [#4374](https://github.com/microsoft/vscode-cmake-tools/issues/4374)

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3790,6 +3790,7 @@
37903790
"@types/chai": "^4.2.15",
37913791
"@types/chai-as-promised": "^7.1.3",
37923792
"@types/chai-string": "^1.4.2",
3793+
"@types/demangler-js": "^0.1.0",
37933794
"@types/js-yaml": "^4.0.0",
37943795
"@types/json5": "~0.0.30",
37953796
"@types/lodash": "4.14.202",
@@ -3844,6 +3845,7 @@
38443845
"@types/string.prototype.matchall": "^4.0.4",
38453846
"ajv": "^7.1.0",
38463847
"chokidar": "^3.5.1",
3848+
"demangler-js": "^0.1.7",
38473849
"handlebars": "^4.7.7",
38483850
"iconv-lite": "^0.6.2",
38493851
"js-yaml": "^4.0.0",

src/coverage.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
22
import { lcovParser } from "@friedemannsommer/lcov-parser";
33
import * as nls from 'vscode-nls';
44
import * as logging from '@cmt/logging';
5+
import { demangle } from 'demangler-js';
56
import { platformNormalizePath } from './util';
67

78
nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })();
@@ -61,7 +62,8 @@ export async function handleCoverageInfoFiles(run: vscode.TestRun, coverageInfoF
6162

6263
const declarations: vscode.DeclarationCoverage[] = [];
6364
for (const declaration of section.functions.details) {
64-
declarations.push(new vscode.DeclarationCoverage(declaration.name, declaration.hit,
65+
const demangledName = demangle(declaration.name);
66+
declarations.push(new vscode.DeclarationCoverage(demangledName, declaration.hit,
6567
new vscode.Position(declaration.line - 1, 0)));
6668
}
6769

yarn.lock

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,11 @@
547547
resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/chai/-/chai-4.3.1.tgz"
548548
integrity sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ==
549549

550+
"@types/demangler-js@^0.1.0":
551+
version "0.1.0"
552+
resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/demangler-js/-/demangler-js-0.1.0.tgz#938a0f160ece42b3cf8d46f3b0ab1218f46821e6"
553+
integrity sha1-k4oPFg7OQrPPjUbzsKsSGPRoIeY=
554+
550555
"@types/estree@^1.0.5":
551556
version "1.0.6"
552557
resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50"
@@ -2232,6 +2237,11 @@ delegates@^1.0.0:
22322237
resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/delegates/-/delegates-1.0.0.tgz"
22332238
integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
22342239

2240+
demangler-js@^0.1.7:
2241+
version "0.1.7"
2242+
resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/demangler-js/-/demangler-js-0.1.7.tgz#42454730da691746e35c5e8861900192be1cbc4d"
2243+
integrity sha1-QkVHMNppF0bjXF6IYZABkr4cvE0=
2244+
22352245
deprecation@^2.0.0, deprecation@^2.3.1:
22362246
version "2.3.1"
22372247
resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/deprecation/-/deprecation-2.3.1.tgz"

0 commit comments

Comments
 (0)