Skip to content

Commit 40e2ce2

Browse files
committed
Ensures property comments get into docs
1 parent cbf83ce commit 40e2ce2

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

docs/telemetry-events.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
'global.cloudIntegrations.connected.count': number,
2929
'global.cloudIntegrations.connected.ids': string,
3030
'global.debugging': boolean,
31+
// Cohort number between 1 and 100 to use for percentage-based rollouts
3132
'global.device.cohort': number,
3233
'global.enabled': boolean,
3334
'global.folders.count': number,
@@ -419,9 +420,12 @@ or
419420
420421
```typescript
421422
{
423+
// Named for compatibility with other GK surfaces
422424
'draftId': string,
423425
'provider': string,
426+
// Named for compatibility with other GK surfaces
424427
'reason': 'committed' | 'rejected' | 'accepted',
428+
// Named for compatibility with other GK surfaces
425429
'repoPrivacy': 'private' | 'public' | 'local',
426430
'repository.visibility': 'private' | 'public' | 'local'
427431
}
@@ -433,12 +437,17 @@ or
433437
434438
```typescript
435439
{
440+
// Named for compatibility with other GK surfaces
436441
'draftId': string,
442+
// Named for compatibility with other GK surfaces
437443
'draftPrivacy': 'private' | 'public' | 'invite_only' | 'provider_access',
444+
// Named for compatibility with other GK surfaces
438445
'filesChanged': number,
439446
'provider': string,
447+
// Named for compatibility with other GK surfaces
440448
'repoPrivacy': 'private' | 'public' | 'local',
441449
'repository.visibility': 'private' | 'public' | 'local',
450+
// Named for compatibility with other GK surfaces
442451
'source': 'reviewMode'
443452
}
444453
```
@@ -449,11 +458,15 @@ or
449458
450459
```typescript
451460
{
461+
// Named for compatibility with other GK surfaces
452462
'draftId': string,
463+
// Named for compatibility with other GK surfaces
453464
'draftPrivacy': 'private' | 'public' | 'invite_only' | 'provider_access',
454465
'provider': string,
466+
// Named for compatibility with other GK surfaces
455467
'repoPrivacy': 'private' | 'public' | 'local',
456468
'repository.visibility': 'private' | 'public' | 'local',
469+
// Named for compatibility with other GK surfaces
457470
'source': string
458471
}
459472
```
@@ -1443,8 +1456,10 @@ void
14431456
{
14441457
'filesChanged': number,
14451458
'provider': string,
1459+
// Provided for compatibility with other GK surfaces
14461460
'repoPrivacy': 'private' | 'public' | 'local',
14471461
'repository.visibility': 'private' | 'public' | 'local',
1462+
// Provided for compatibility with other GK surfaces
14481463
'source': 'account' | 'subscription' | 'graph' | 'patchDetails' | 'settings' | 'timeline' | 'home' | 'view' | 'code-suggest' | 'associateIssueWithBranch' | 'cloud-patches' | 'commandPalette' | 'deeplink' | 'inspect' | 'inspect-overview' | 'integrations' | 'launchpad' | 'launchpad-indicator' | 'launchpad-view' | 'notification' | 'prompt' | 'quick-wizard' | 'remoteProvider' | 'startWork' | 'trial-indicator' | 'scm-input' | 'walkthrough' | 'whatsnew' | 'worktrees'
14491464
}
14501465
```
@@ -1772,9 +1787,12 @@ or
17721787

17731788
```typescript
17741789
{
1790+
// `true` if the user cancels the VS Code prompt to open the browser
17751791
'aborted': boolean,
17761792
'action': 'upgrade',
1793+
// Promo discount code associated with the upgrade
17771794
'promo.code': string,
1795+
// Promo key (identifier) associated with the upgrade
17781796
'promo.key': string
17791797
}
17801798
```

scripts/generateTelemetryDocs.mjs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,14 @@ function expandType(file, type, indent = '', isRoot = true, prefix = '') {
121121
/** @type {Prop[]} */
122122
let expandedProps = properties.map(prop => {
123123
const propType = typeChecker.getTypeOfSymbolAtLocation(prop, file);
124-
const jsDocTags = getJSDocTags(prop);
125124
let propString = '';
125+
126+
const propDocs = prop.getDocumentationComment(typeChecker);
127+
if (propDocs.length > 0) {
128+
propString += `${indent} // ${propDocs.map(doc => doc.text).join(' ')}\n`;
129+
}
130+
131+
const jsDocTags = getJSDocTags(prop);
126132
if (jsDocTags.deprecated) {
127133
propString += `${indent} // @deprecated: ${jsDocTags.deprecated}\n`;
128134
}
@@ -152,6 +158,7 @@ function expandType(file, type, indent = '', isRoot = true, prefix = '') {
152158
const keyType = typeChecker.typeToString(indexInfo.keyType);
153159
const name = `${prefix}${keyType.substring(1, keyType.length - 1)}`;
154160
const valueType = expandType(file, indexInfo.type, indent + ' ', false, prefix);
161+
155162
return {
156163
name: name,
157164
result: `${indent} [\`${name}\`]: ${valueType}`,
@@ -214,8 +221,14 @@ function expandType(file, type, indent = '', isRoot = true, prefix = '') {
214221
/** @type {Prop[]} */
215222
const expandedProps = [...mergedProperties].map(([, prop]) => {
216223
const propType = typeChecker.getTypeOfSymbolAtLocation(prop, file);
217-
const jsDocTags = getJSDocTags(prop);
218224
let propString = '';
225+
226+
const propDocs = prop.getDocumentationComment(typeChecker);
227+
if (propDocs.length > 0) {
228+
propString += `${indent} // ${propDocs.map(doc => doc.text).join(' ')}\n`;
229+
}
230+
231+
const jsDocTags = getJSDocTags(prop);
219232
if (jsDocTags.deprecated) {
220233
propString += `${indent} // @deprecated: ${jsDocTags.deprecated}\n`;
221234
}

src/constants.telemetry.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,8 +809,11 @@ type SubscriptionActionEventData =
809809
}
810810
| {
811811
action: 'upgrade';
812+
/** `true` if the user cancels the VS Code prompt to open the browser */
812813
aborted: boolean;
814+
/** Promo key (identifier) associated with the upgrade */
813815
'promo.key'?: string;
816+
/** Promo discount code associated with the upgrade */
814817
'promo.code'?: string;
815818
}
816819
| {

0 commit comments

Comments
 (0)