From e2f47a2db15719472407df2f2da993360e9a2298 Mon Sep 17 00:00:00 2001 From: Andrew Casey Date: Wed, 3 Nov 2021 10:37:31 -0700 Subject: [PATCH] Duplicate GDPR fragment from VS Code repo (#46625) * Duplicate GDPR fragment from VS Code repo ...because the tool doesn't handle cross-repro references. * Explain functionality in more detail --- src/server/protocol.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/server/protocol.ts b/src/server/protocol.ts index da660679672..7084d1e05dd 100644 --- a/src/server/protocol.ts +++ b/src/server/protocol.ts @@ -3199,6 +3199,25 @@ namespace ts.server.protocol { payload: TypingsInstalledTelemetryEventPayload; } + // A __GDPR__FRAGMENT__ has no meaning until it is ${include}d by a __GDPR__ comment, at which point + // the included properties are effectively inlined into the __GDPR__ declaration. In this case, for + // example, any __GDPR__ comment including the TypeScriptCommonProperties will be updated with an + // additional version property with the classification below. Obviously, the purpose of such a construct + // is to reduce duplication and keep multiple use sites consistent (e.g. by making sure that all reflect + // any newly added TypeScriptCommonProperties). Unfortunately, the system has limits - in particular, + // these reusable __GDPR__FRAGMENT__s are not accessible across repo boundaries. Therefore, even though + // the code for adding the common properties (i.e. version), along with the corresponding __GDPR__FRAGMENT__, + // lives in the VS Code repo (see https://github.com/microsoft/vscode/blob/main/extensions/typescript-language-features/src/utils/telemetry.ts) + // we have to duplicate it here. It would be nice to keep them in sync, but the only likely failure mode + // is adding a property to the VS Code repro but not here and the only consequence would be having that + // property suppressed on the events (i.e. __GDPT__ comments) in this repo that reference the out-of-date + // local __GDPR__FRAGMENT__. + /* __GDPR__FRAGMENT__ + "TypeScriptCommonProperties" : { + "version" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" } + } + */ + /* __GDPR__ "typingsinstalled" : { "${include}": ["${TypeScriptCommonProperties}"],