Skip to content

Commit

Permalink
add telemetry for missing files (#5944)
Browse files Browse the repository at this point in the history
  • Loading branch information
elahehrashedi authored Aug 11, 2020
1 parent b063b69 commit 8246ad0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Extension/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,9 @@ export function getInstalledBinaryPlatform(): string | undefined {
} else if (checkFileExistsSync(path.join(extensionPath, "LLVM/bin/clang-format"))) {
installedPlatform = "linux";
}
if (!installedPlatform) {
Telemetry.logLanguageServerEvent("missingBinary", { "source": "clang-format" });
}
return installedPlatform;
}

Expand All @@ -572,7 +575,9 @@ export async function checkInstallBinariesExist(): Promise<boolean> {
await Promise.all(pkg.binaries.map(async (file: string) => {
if (!await checkFileExists(file)) {
installBinariesExist = false;
console.log(`Extension file ${file} is missing.`);
const fileBase: string = path.basename(file);
console.log(`Extension file ${fileBase} is missing.`);
Telemetry.logLanguageServerEvent("missingBinary", { "source": `${fileBase}` });
}
}));
}
Expand Down Expand Up @@ -603,6 +608,7 @@ export async function checkInstallJsonsExist(): Promise<boolean> {
if (!await checkFileExists(path.join(extensionPath, file))) {
installJsonsExist = false;
console.log(`Extension file ${file} is missing.`);
Telemetry.logLanguageServerEvent("missingJson", { "source": `${file}` });
}
}));
return installJsonsExist;
Expand Down

0 comments on commit 8246ad0

Please sign in to comment.