MCPcopy
hub / github.com/microsoft/vscode-js-debug / reportBootTelemetry

Method reportBootTelemetry

src/binder.ts:257–291  ·  view source on GitHub ↗
(rawParams: AnyLaunchConfiguration)

Source from the content-addressed store, hash-verified

255 }
256
257 private reportBootTelemetry(rawParams: AnyLaunchConfiguration) {
258 const defaults = applyDefaults({
259 type: rawParams.type,
260 request: rawParams.request,
261 name: '<string>',
262 __workspaceFolder: '<workspace>',
263 } as AnyResolvingConfiguration) as unknown as { [key: string]: unknown };
264
265 // Sanitization function that strips non-default strings from the launch
266 // config, to avoid unnecessarily collecting information about the workspace.
267 const sanitizer = (value: unknown, key?: string): unknown => {
268 if (typeof value === 'string') {
269 return key && defaults[key] === value ? value : `<string>`;
270 }
271
272 if (value instanceof Array) {
273 return value.map(v => sanitizer(v));
274 }
275
276 if (value && typeof value === 'object') {
277 return mapValues(value as { [key: string]: unknown }, v => sanitizer(v));
278 }
279
280 return value;
281 };
282
283 this._rootServices.get<ITelemetryReporter>(ITelemetryReporter).report('launch', {
284 type: rawParams.type,
285 request: rawParams.request,
286 os: `${os.platform()} ${os.arch()}`,
287 nodeVersion: process.version,
288 adapterVersion: packageVersion,
289 parameters: mapValues(rawParams as unknown as { [key: string]: unknown }, sanitizer),
290 });
291 }
292
293 async _restart(newParams?: AnyResolvingConfiguration) {
294 let resolved: AnyLaunchConfiguration | undefined;

Callers 1

_bootMethod · 0.95

Calls 4

applyDefaultsFunction · 0.90
mapValuesFunction · 0.90
reportMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected