Skip to content

Commit cf58757

Browse files
committed
add telemetry
1 parent af6374d commit cf58757

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Extension/src/LanguageServer/extension.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,8 +431,8 @@ export async function registerCommands(enabled: boolean): Promise<void> {
431431
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExtractToMemberFunction', enabled ? () => onExtractToFunction(false, true) : onDisabledCommand));
432432
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ExpandSelection', enabled ? (r: Range) => onExpandSelection(r) : onDisabledCommand));
433433
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ShowCopilotHover', enabled ? () => onCopilotHover() : onDisabledCommand));
434-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetDevEnvironment', enabled ? () => onSetDevEnvironment() : onDisabledCommand));
435-
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearDevEnvironment', enabled ? () => onClearDevEnvironment() : onDisabledCommand));
434+
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.SetDevEnvironment', enabled ? onSetDevEnvironment : onDisabledCommand));
435+
commandDisposables.push(vscode.commands.registerCommand('C_Cpp.ClearDevEnvironment', enabled ? onClearDevEnvironment : onDisabledCommand));
436436
}
437437

438438
function onDisabledCommand() {
@@ -1562,14 +1562,17 @@ async function showCopilotContent(copilotHoverProvider: CopilotHoverProvider, ho
15621562
return true;
15631563
}
15641564

1565-
async function onSetDevEnvironment(): Promise<void> {
1565+
async function onSetDevEnvironment(sender?: any): Promise<void> {
1566+
let success: boolean = true;
15661567
try {
15671568
await setEnvironment(util.extensionContext);
15681569
await vscode.commands.executeCommand('setContext', 'cpptools.msvcEnvironmentFound', util.hasMsvcEnvironment());
15691570
void vscode.window.showInformationMessage(`${util.extensionContext?.environmentVariableCollection.description} successfully set.`);
15701571
} catch (error: any) {
1572+
success = false;
15711573
void vscode.window.showErrorMessage(`Developer environment not set: ${error.message}`);
15721574
}
1575+
telemetry.logLanguageServerEvent("SetDevEnvironment", { "sender": util.getSenderType(sender), success: success.toString() });
15731576
}
15741577

15751578
async function onClearDevEnvironment(): Promise<void> {

Extension/walkthrough/devcommandprompt/open-developer-command-prompt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<h1 data-loc-id="walkthrough.windows.title.open.dev.command.prompt">Relaunch using the <span>Developer Command Prompt for VS</span></h1>
2-
<p data-loc-id="walkthrough.windows.background.dev.command.prompt">You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:</p>
2+
<p data-loc-id="walkthrough.windows.background.dev.command.prompt" data-loc-hint="This is an incomplete sentence that will be continued in the bullet points to follow">You are using a Windows machine with the MSVC compiler, so for all environment variables to be set correctly, you either need to:</p>
33
<ul>
44
<li><p data-loc-id="walkthrough.windows.start.from.dev.command">Start VS Code from the <span>Developer Command Prompt for VS</span>, or</p>
55
</li>
6-
<li><p data-loc-id="walkthrough.windows.run.dev.command">Run the <code>C/C++: Set Developer Environment</code> command.</p>
6+
<li><p data-loc-id="walkthrough.windows.run.dev.command">Run the <code data-loc-id="walkthrough.windows.set.dev.environment">C/C++: Set Developer Environment</code> command.</p>
77
</li>
88
</ul>
99
<h4 data-loc-id="walkthrough.windows.relaunch.command.prompt">To relaunch using the <span>Developer Command Prompt for VS</span></h4>

0 commit comments

Comments
 (0)