Merge from vscode 5b9869eb02fa4c96205a74d05cad9164dfd06d60 (#5607)

This commit is contained in:
Anthony Dresser
2019-05-24 12:20:30 -07:00
committed by GitHub
parent 361ada4963
commit bcc449b524
126 changed files with 3096 additions and 2255 deletions

View File

@@ -10,8 +10,9 @@ import { readFile } from 'vs/base/node/pfs';
// {{SQL CARBON EDIT}}
import product from 'vs/platform/product/node/product';
const productObject = product;
export function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, installSourcePath: string): Promise<{ [name: string]: string | undefined; }> {
export async function resolveCommonProperties(commit: string | undefined, version: string | undefined, machineId: string | undefined, installSourcePath: string, product?: string): Promise<{ [name: string]: string | undefined; }> {
const result: { [name: string]: string | undefined; } = Object.create(null);
// {{SQL CARBON EDIT}}
@@ -36,8 +37,8 @@ export function resolveCommonProperties(commit: string | undefined, version: str
result['common.nodeArch'] = process.arch;
// __GDPR__COMMON__ "common.product" : { "classification": "SystemMetaData", "purpose": "PerformanceAndHealth" }
// {{SQL CARBON EDIT}}
result['common.product'] = product.nameShort || 'desktop';
result['common.application.name'] = product.nameLong;
result['common.product'] = productObject.nameShort || 'desktop';
result['common.application.name'] = productObject.nameLong;
// dynamic properties which value differs on each call
let seq = 0;
@@ -65,13 +66,14 @@ export function resolveCommonProperties(commit: string | undefined, version: str
result['common.snap'] = 'true';
}
return readFile(installSourcePath, 'utf8').then(contents => {
try {
const contents = await readFile(installSourcePath, 'utf8');
// __GDPR__COMMON__ "common.source" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
result['common.source'] = contents.slice(0, 30);
} catch (error) {
// ignore error
}
return result;
}, error => {
return result;
});
return result;
}