Skip to content

Commit b25fb3f

Browse files
authored
Update Mac crash telemetry for cpptools-wordexp. (#9308)
* Update Mac crash telemetry for cpptools-wordexp.
1 parent f3b60f2 commit b25fb3f

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Extension/src/LanguageServer/extension.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -872,17 +872,19 @@ function handleMacCrashFileRead(err: NodeJS.ErrnoException | undefined | null, d
872872
data = data.replace(/0x1........ \+ 0/g, "");
873873

874874
// Get rid of the process names on each line and just add it to the start.
875-
const process1: string = "cpptools-srv";
876-
const process2: string = "cpptools";
877-
if (data.includes(process1)) {
878-
data = data.replace(new RegExp(process1 + "\\s+", "g"), "");
879-
data = `${process1}\t${binaryVersion}\n${data}`;
880-
} else if (data.includes(process2)) {
881-
data = data.replace(new RegExp(process2 + "\\s+", "g"), "");
882-
data = `${process2}\t${binaryVersion}\n${data}`;
883-
} else {
884-
// Not expected, but just in case.
885-
data = `cpptools?\t${binaryVersion}\n${data}`;
875+
const processNames: string[] = ["cpptools-srv", "cpptools-wordexp", "cpptools" ];
876+
let processNameFound: boolean = false;
877+
for (const processName of processNames) {
878+
if (data.includes(processName)) {
879+
data = data.replace(new RegExp(processName + "\\s+", "g"), "");
880+
data = `${processName}\t${binaryVersion}\n${data}`;
881+
processNameFound = true;
882+
break;
883+
}
884+
}
885+
if (!processNameFound) {
886+
// Not expected, but just in case a new binary gets added.
887+
data = `cpptools???\t${binaryVersion}\n${data}`;
886888
}
887889

888890
// Remove runtime lines because they can be different on different machines.

0 commit comments

Comments
 (0)