Skip to content

Commit 4a8a44e

Browse files
committed
Add a test that illustrates the visitor bug
1 parent 341af7e commit 4a8a44e

File tree

5 files changed

+260
-0
lines changed

5 files changed

+260
-0
lines changed

build-tests/api-extractor-scenarios/config/build-config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"defaultExportOfEntryPoint3",
1010
"defaultExportOfEntryPoint4",
1111
"docReferences",
12+
"docReferences2",
1213
"exportDuplicate",
1314
"exportEquals",
1415
"exportImportedExternal",
Lines changed: 196 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,196 @@
1+
{
2+
"metadata": {
3+
"toolPackage": "@microsoft/api-extractor",
4+
"toolVersion": "[test mode]",
5+
"schemaVersion": 1000
6+
},
7+
"kind": "Package",
8+
"canonicalReference": "api-extractor-scenarios",
9+
"docComment": "",
10+
"name": "api-extractor-scenarios",
11+
"members": [
12+
{
13+
"kind": "EntryPoint",
14+
"canonicalReference": "",
15+
"name": "",
16+
"members": [
17+
{
18+
"kind": "Class",
19+
"canonicalReference": "(CyclicA:class)",
20+
"docComment": "/**\n * @public\n */\n",
21+
"excerptTokens": [
22+
{
23+
"kind": "Content",
24+
"text": "export declare class "
25+
},
26+
{
27+
"kind": "Reference",
28+
"text": "CyclicA"
29+
},
30+
{
31+
"kind": "Content",
32+
"text": " "
33+
}
34+
],
35+
"releaseTag": "Public",
36+
"name": "CyclicA",
37+
"members": [
38+
{
39+
"kind": "Method",
40+
"canonicalReference": "(methodA1:instance,0)",
41+
"docComment": "",
42+
"excerptTokens": [
43+
{
44+
"kind": "Reference",
45+
"text": "methodA1"
46+
},
47+
{
48+
"kind": "Content",
49+
"text": "(): "
50+
},
51+
{
52+
"kind": "Content",
53+
"text": "void"
54+
},
55+
{
56+
"kind": "Content",
57+
"text": ";"
58+
}
59+
],
60+
"isStatic": false,
61+
"returnTypeTokenRange": {
62+
"startIndex": 2,
63+
"endIndex": 3
64+
},
65+
"releaseTag": "Public",
66+
"overloadIndex": 0,
67+
"parameters": [],
68+
"name": "methodA1"
69+
},
70+
{
71+
"kind": "Method",
72+
"canonicalReference": "(methodA3:instance,0)",
73+
"docComment": "/**\n * THE COMMENT\n */\n",
74+
"excerptTokens": [
75+
{
76+
"kind": "Reference",
77+
"text": "methodA3"
78+
},
79+
{
80+
"kind": "Content",
81+
"text": "(): "
82+
},
83+
{
84+
"kind": "Content",
85+
"text": "void"
86+
},
87+
{
88+
"kind": "Content",
89+
"text": ";"
90+
}
91+
],
92+
"isStatic": false,
93+
"returnTypeTokenRange": {
94+
"startIndex": 2,
95+
"endIndex": 3
96+
},
97+
"releaseTag": "Public",
98+
"overloadIndex": 0,
99+
"parameters": [],
100+
"name": "methodA3"
101+
}
102+
],
103+
"implementsTokenRanges": []
104+
},
105+
{
106+
"kind": "Class",
107+
"canonicalReference": "(CyclicB:class)",
108+
"docComment": "/**\n * @public\n */\n",
109+
"excerptTokens": [
110+
{
111+
"kind": "Content",
112+
"text": "export declare class "
113+
},
114+
{
115+
"kind": "Reference",
116+
"text": "CyclicB"
117+
},
118+
{
119+
"kind": "Content",
120+
"text": " "
121+
}
122+
],
123+
"releaseTag": "Public",
124+
"name": "CyclicB",
125+
"members": [
126+
{
127+
"kind": "Method",
128+
"canonicalReference": "(methodB2:instance,0)",
129+
"docComment": "/**\n * THE COMMENT\n */\n",
130+
"excerptTokens": [
131+
{
132+
"kind": "Reference",
133+
"text": "methodB2"
134+
},
135+
{
136+
"kind": "Content",
137+
"text": "(): "
138+
},
139+
{
140+
"kind": "Content",
141+
"text": "void"
142+
},
143+
{
144+
"kind": "Content",
145+
"text": ";"
146+
}
147+
],
148+
"isStatic": false,
149+
"returnTypeTokenRange": {
150+
"startIndex": 2,
151+
"endIndex": 3
152+
},
153+
"releaseTag": "Public",
154+
"overloadIndex": 0,
155+
"parameters": [],
156+
"name": "methodB2"
157+
},
158+
{
159+
"kind": "Method",
160+
"canonicalReference": "(methodB4:instance,0)",
161+
"docComment": "/**\n * THE COMMENT\n */\n",
162+
"excerptTokens": [
163+
{
164+
"kind": "Reference",
165+
"text": "methodB4"
166+
},
167+
{
168+
"kind": "Content",
169+
"text": "(): "
170+
},
171+
{
172+
"kind": "Content",
173+
"text": "void"
174+
},
175+
{
176+
"kind": "Content",
177+
"text": ";"
178+
}
179+
],
180+
"isStatic": false,
181+
"returnTypeTokenRange": {
182+
"startIndex": 2,
183+
"endIndex": 3
184+
},
185+
"releaseTag": "Public",
186+
"overloadIndex": 0,
187+
"parameters": [],
188+
"name": "methodB4"
189+
}
190+
],
191+
"implementsTokenRanges": []
192+
}
193+
]
194+
}
195+
]
196+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## API Review File for "api-extractor-scenarios"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
// @public (undocumented)
8+
export class CyclicA {
9+
// (undocumented)
10+
methodA1(): void;
11+
methodA3(): void;
12+
}
13+
14+
// @public (undocumented)
15+
export class CyclicB {
16+
methodB2(): void;
17+
methodB4(): void;
18+
}
19+
20+
21+
// (No @packageDocumentation comment for this package)
22+
23+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
/** @public */
3+
export declare class CyclicA {
4+
/** {@inheritDoc CyclicB.methodB2} */
5+
methodA1(): void;
6+
/** {@inheritDoc CyclicB.methodB4} */
7+
methodA3(): void;
8+
}
9+
10+
/** @public */
11+
export declare class CyclicB {
12+
/** {@inheritDoc CyclicA.methodA3} */
13+
methodB2(): void;
14+
/** THE COMMENT */
15+
methodB4(): void;
16+
}
17+
18+
export { }
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+
// See LICENSE in the project root for license information.
3+
4+
/** @public */
5+
export class CyclicA {
6+
/** {@inheritDoc CyclicB.methodB2} */
7+
public methodA1(): void {
8+
}
9+
/** {@inheritDoc CyclicB.methodB4} */
10+
public methodA3(): void {
11+
}
12+
}
13+
14+
/** @public */
15+
export class CyclicB {
16+
/** {@inheritDoc CyclicA.methodA3} */
17+
public methodB2(): void {
18+
}
19+
/** THE COMMENT */
20+
public methodB4(): void {
21+
}
22+
}

0 commit comments

Comments
 (0)