From 7894b724d70c096983a876918d7d4e8691516d65 Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 13 Feb 2025 12:50:40 -0800 Subject: [PATCH 1/2] Fix handling of "Could not open input path" when calling c++filt --- Extension/CHANGELOG.md | 1 + Extension/src/LanguageServer/extension.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index 5222340c6..abdc33131 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -4,6 +4,7 @@ ### Bug Fixes * Fix random IntelliSense process crashes on Linux/macOS when `C_Cpp.intelliSenseCacheSize` is > 0. [#12668](https://github.com/microsoft/vscode-cpptools/issues/12668) * Fix a crash when processing Copilot snippets. +* Fix a crash when using Copilot hover. ## Version 1.24.0: February 11, 2025 ### New Feature diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 58af8a4b0..a998897f1 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -1224,7 +1224,7 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, cr if (ret?.output === funcStr) { ret = await util.spawnChildProcess(filtPath, [funcStr], undefined, true).catch(logAndReturn.undefined); } - if (ret !== undefined && ret.succeeded) { + if (ret !== undefined && ret.succeeded && !ret.output.includes("Could not open input file")) { funcStr = ret.output; funcStr = funcStr.replace(/std::(?:__1|__cxx11)/g, "std"); // simplify std namespaces. funcStr = funcStr.replace(/std::basic_/g, "std::"); From 9a814e5c669c9cbeec11b7d1e5ef008685674e7a Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Thu, 13 Feb 2025 12:54:18 -0800 Subject: [PATCH 2/2] Switch to startsWith. --- Extension/src/LanguageServer/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index a998897f1..11c7e6576 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -1224,7 +1224,7 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, cr if (ret?.output === funcStr) { ret = await util.spawnChildProcess(filtPath, [funcStr], undefined, true).catch(logAndReturn.undefined); } - if (ret !== undefined && ret.succeeded && !ret.output.includes("Could not open input file")) { + if (ret !== undefined && ret.succeeded && !ret.output.startsWith("Could not open input file")) { funcStr = ret.output; funcStr = funcStr.replace(/std::(?:__1|__cxx11)/g, "std"); // simplify std namespaces. funcStr = funcStr.replace(/std::basic_/g, "std::");