Skip to content

Commit

Permalink
add telemetry for developer environment use (#3975)
Browse files Browse the repository at this point in the history
  • Loading branch information
gcampbell-msft authored Aug 13, 2024
1 parent 2aeab8d commit b77a853
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
12 changes: 10 additions & 2 deletions src/drivers/cmakeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1562,8 +1562,16 @@ export abstract class CMakeDriver implements vscode.Disposable {
telemetryProperties.CppCompilerName = 'cl';
}

if (this._kit?.visualStudioArchitecture) {
telemetryProperties.VisualStudioArchitecture = this._kit?.visualStudioArchitecture;
if (this.useCMakePresets) {
const arch = presetOverride ? presetOverride.__developerEnvironmentArchitecture : this._configurePreset ? this._configurePreset.__developerEnvironmentArchitecture : undefined;
if (arch) {
telemetryProperties.VisualStudioArchitecture = arch;
}
} else {
if (this._kit?.visualStudioArchitecture) {
telemetryProperties.VisualStudioArchitecture =
this._kit?.visualStudioArchitecture;
}
}

const telemetryMeasures: telemetry.Measures = {
Expand Down
9 changes: 8 additions & 1 deletion src/preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ export interface ConfigurePreset extends Preset {
vendor?: VendorVsSettings | VendorType;
toolchainFile?: string;
installDir?: string;

// Private fields
__developerEnvironmentArchitecture?: string; // Private field to indicate which VS Dev Env architecture we're using, if VS Dev Env is used.
}

export interface InheritsConfigurePreset extends Preset {
Expand Down Expand Up @@ -1088,7 +1091,11 @@ async function tryApplyVsDevEnv(preset: ConfigurePreset, workspaceFolder: string
}
}

preset.__parentEnvironment = EnvironmentUtils.mergePreserveNull([process.env, developerEnvironment]);
if (developerEnvironment) {
preset.__developerEnvironmentArchitecture = getArchitecture(preset);
}

preset.__parentEnvironment = EnvironmentUtils.mergePreserveNull([process.env, preset.__parentEnvironment, developerEnvironment]);
}
/**
* Expands the configure preset variables.
Expand Down

0 comments on commit b77a853

Please sign in to comment.