diff --git a/CHANGELOG.md b/CHANGELOG.md index e9324a9d0c..a0ab277227 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,12 +9,13 @@ Features: Improvements: +- 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) - 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) Bug Fixes: - Fix bug that makes `Configure Task` lists only first folder in workspace. [#3232](https//github.com/microsoft/vscode-cmake-tools/issues/3232) -- 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) +- 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) - 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) - 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) - Fixes localization for "workspace is" string. [#4374](https://github.com/microsoft/vscode-cmake-tools/issues/4374) diff --git a/package.json b/package.json index a999d5ced6..44976b1d23 100644 --- a/package.json +++ b/package.json @@ -3769,6 +3769,7 @@ "@types/chai": "^4.2.15", "@types/chai-as-promised": "^7.1.3", "@types/chai-string": "^1.4.2", + "@types/demangler-js": "^0.1.0", "@types/js-yaml": "^4.0.0", "@types/json5": "~0.0.30", "@types/lodash": "4.14.202", @@ -3823,6 +3824,7 @@ "@types/string.prototype.matchall": "^4.0.4", "ajv": "^7.1.0", "chokidar": "^3.5.1", + "demangler-js": "^0.1.7", "handlebars": "^4.7.7", "iconv-lite": "^0.6.2", "js-yaml": "^4.0.0", diff --git a/src/coverage.ts b/src/coverage.ts index b67feabf4e..801f56c690 100644 --- a/src/coverage.ts +++ b/src/coverage.ts @@ -2,6 +2,7 @@ import * as vscode from 'vscode'; import { lcovParser } from "@friedemannsommer/lcov-parser"; import * as nls from 'vscode-nls'; import * as logging from '@cmt/logging'; +import { demangle } from 'demangler-js'; import { platformNormalizePath } from './util'; nls.config({ messageFormat: nls.MessageFormat.bundle, bundleFormat: nls.BundleFormat.standalone })(); @@ -61,7 +62,8 @@ export async function handleCoverageInfoFiles(run: vscode.TestRun, coverageInfoF const declarations: vscode.DeclarationCoverage[] = []; for (const declaration of section.functions.details) { - declarations.push(new vscode.DeclarationCoverage(declaration.name, declaration.hit, + const demangledName = demangle(declaration.name); + declarations.push(new vscode.DeclarationCoverage(demangledName, declaration.hit, new vscode.Position(declaration.line - 1, 0))); } diff --git a/yarn.lock b/yarn.lock index f2e158f0d6..5b48b2e9f9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -547,6 +547,11 @@ resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/chai/-/chai-4.3.1.tgz" integrity sha512-/zPMqDkzSZ8t3VtxOa4KPq7uzzW978M9Tvh+j7GHKuo6k6GTLxPJ4J5gE5cjfJ26pnXst0N5Hax8Sr0T2Mi9zQ== +"@types/demangler-js@^0.1.0": + version "0.1.0" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/@types/demangler-js/-/demangler-js-0.1.0.tgz#938a0f160ece42b3cf8d46f3b0ab1218f46821e6" + integrity sha1-k4oPFg7OQrPPjUbzsKsSGPRoIeY= + "@types/estree@^1.0.5": version "1.0.6" 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: resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/delegates/-/delegates-1.0.0.tgz" integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o= +demangler-js@^0.1.7: + version "0.1.7" + resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/demangler-js/-/demangler-js-0.1.7.tgz#42454730da691746e35c5e8861900192be1cbc4d" + integrity sha1-QkVHMNppF0bjXF6IYZABkr4cvE0= + deprecation@^2.0.0, deprecation@^2.3.1: version "2.3.1" resolved "https://pkgs.dev.azure.com/azure-public/VisualCpp/_packaging/cpp_PublicPackages/npm/registry/deprecation/-/deprecation-2.3.1.tgz"