Skip to content

Commit e601c0c

Browse files
authored
feat(jsii): record source locations in assembly (#429)
1 parent 265c304 commit e601c0c

22 files changed

Lines changed: 4102 additions & 24 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ tsconfig.tsbuildinfo
66
.idea
77
.vs
88
/dist
9+
.vscode

packages/jsii-calc-base-of-base/test/assembly.jsii

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,16 @@
4545
"initializer": true
4646
},
4747
"kind": "class",
48+
"locationInModule": {
49+
"filename": "lib/index.ts",
50+
"line": 5
51+
},
4852
"methods": [
4953
{
54+
"locationInModule": {
55+
"filename": "lib/index.ts",
56+
"line": 6
57+
},
5058
"name": "hey",
5159
"returns": {
5260
"primitive": "number"
@@ -60,11 +68,19 @@
6068
"datatype": true,
6169
"fqn": "@scope/jsii-calc-base-of-base.VeryBaseProps",
6270
"kind": "interface",
71+
"locationInModule": {
72+
"filename": "lib/index.ts",
73+
"line": 1
74+
},
6375
"name": "VeryBaseProps",
6476
"properties": [
6577
{
6678
"abstract": true,
6779
"immutable": true,
80+
"locationInModule": {
81+
"filename": "lib/index.ts",
82+
"line": 2
83+
},
6884
"name": "foo",
6985
"type": {
7086
"fqn": "@scope/jsii-calc-base-of-base.Very"
@@ -74,5 +90,5 @@
7490
}
7591
},
7692
"version": "0.8.2",
77-
"fingerprint": "II5j+yUrBn6dB/gWFSs9fbCeaOJTu2szjv0xtMpkn80="
93+
"fingerprint": "2FCIfxrvj5VhyzTpKaFKTg5dD0ix1DAx3o9DdB38894="
7894
}

packages/jsii-calc-base/test/assembly.jsii

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,19 @@
7575
"initializer": true
7676
},
7777
"kind": "class",
78+
"locationInModule": {
79+
"filename": "lib/index.ts",
80+
"line": 6
81+
},
7882
"methods": [
7983
{
8084
"docs": {
8185
"returns": "the name of the class (to verify native type names are created for derived classes)."
8286
},
87+
"locationInModule": {
88+
"filename": "lib/index.ts",
89+
"line": 10
90+
},
8391
"name": "typeName",
8492
"returns": {
8593
"primitive": "any"
@@ -98,11 +106,19 @@
98106
}
99107
],
100108
"kind": "interface",
109+
"locationInModule": {
110+
"filename": "lib/index.ts",
111+
"line": 15
112+
},
101113
"name": "BaseProps",
102114
"properties": [
103115
{
104116
"abstract": true,
105117
"immutable": true,
118+
"locationInModule": {
119+
"filename": "lib/index.ts",
120+
"line": 16
121+
},
106122
"name": "bar",
107123
"type": {
108124
"primitive": "string"
@@ -112,5 +128,5 @@
112128
}
113129
},
114130
"version": "0.8.2",
115-
"fingerprint": "lIcHicx5rBBxyy5vOvOqvbBGjk//8lFLX6oVx2xh5Fc="
131+
"fingerprint": "ZlEGeLVGfz+JP26QXUzhkZu/rJWK5niWhhadMxfwA40="
116132
}

packages/jsii-calc-lib/test/assembly.jsii

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@
9797
},
9898
"fqn": "@scope/jsii-calc-lib.EnumFromScopedModule",
9999
"kind": "enum",
100+
"locationInModule": {
101+
"filename": "lib/index.ts",
102+
"line": 97
103+
},
100104
"members": [
101105
{
102106
"name": "Value1"
@@ -114,11 +118,19 @@
114118
},
115119
"fqn": "@scope/jsii-calc-lib.IDoublable",
116120
"kind": "interface",
121+
"locationInModule": {
122+
"filename": "lib/index.ts",
123+
"line": 23
124+
},
117125
"name": "IDoublable",
118126
"properties": [
119127
{
120128
"abstract": true,
121129
"immutable": true,
130+
"locationInModule": {
131+
"filename": "lib/index.ts",
132+
"line": 24
133+
},
122134
"name": "doubleValue",
123135
"type": {
124136
"primitive": "number"
@@ -134,12 +146,20 @@
134146
},
135147
"fqn": "@scope/jsii-calc-lib.IFriendly",
136148
"kind": "interface",
149+
"locationInModule": {
150+
"filename": "lib/index.ts",
151+
"line": 58
152+
},
137153
"methods": [
138154
{
139155
"abstract": true,
140156
"docs": {
141157
"summary": "Say hello!"
142158
},
159+
"locationInModule": {
160+
"filename": "lib/index.ts",
161+
"line": 62
162+
},
143163
"name": "hello",
144164
"returns": {
145165
"primitive": "string"
@@ -156,6 +176,10 @@
156176
},
157177
"fqn": "@scope/jsii-calc-lib.MyFirstStruct",
158178
"kind": "interface",
179+
"locationInModule": {
180+
"filename": "lib/index.ts",
181+
"line": 68
182+
},
159183
"name": "MyFirstStruct",
160184
"properties": [
161185
{
@@ -164,6 +188,10 @@
164188
"summary": "An awesome number value."
165189
},
166190
"immutable": true,
191+
"locationInModule": {
192+
"filename": "lib/index.ts",
193+
"line": 77
194+
},
167195
"name": "anumber",
168196
"type": {
169197
"primitive": "number"
@@ -175,6 +203,10 @@
175203
"summary": "A string value."
176204
},
177205
"immutable": true,
206+
"locationInModule": {
207+
"filename": "lib/index.ts",
208+
"line": 72
209+
},
178210
"name": "astring",
179211
"type": {
180212
"primitive": "string"
@@ -183,6 +215,10 @@
183215
{
184216
"abstract": true,
185217
"immutable": true,
218+
"locationInModule": {
219+
"filename": "lib/index.ts",
220+
"line": 78
221+
},
186222
"name": "firstOptional",
187223
"type": {
188224
"collection": {
@@ -228,13 +264,21 @@
228264
}
229265
],
230266
"kind": "class",
267+
"locationInModule": {
268+
"filename": "lib/index.ts",
269+
"line": 30
270+
},
231271
"name": "Number",
232272
"properties": [
233273
{
234274
"docs": {
235275
"summary": "The number multiplied by 2."
236276
},
237277
"immutable": true,
278+
"locationInModule": {
279+
"filename": "lib/index.ts",
280+
"line": 42
281+
},
238282
"name": "doubleValue",
239283
"overrides": {
240284
"fqn": "@scope/jsii-calc-lib.IDoublable"
@@ -248,6 +292,10 @@
248292
"summary": "The number."
249293
},
250294
"immutable": true,
295+
"locationInModule": {
296+
"filename": "lib/index.ts",
297+
"line": 35
298+
},
251299
"name": "value",
252300
"overrides": {
253301
"fqn": "@scope/jsii-calc-lib.Value"
@@ -272,12 +320,20 @@
272320
"initializer": true
273321
},
274322
"kind": "class",
323+
"locationInModule": {
324+
"filename": "lib/index.ts",
325+
"line": 50
326+
},
275327
"methods": [
276328
{
277329
"abstract": true,
278330
"docs": {
279331
"summary": "String representation of the value."
280332
},
333+
"locationInModule": {
334+
"filename": "lib/index.ts",
335+
"line": 51
336+
},
281337
"name": "toString",
282338
"overrides": {
283339
"fqn": "@scope/jsii-calc-lib.Value"
@@ -297,6 +353,10 @@
297353
},
298354
"fqn": "@scope/jsii-calc-lib.StructWithOnlyOptionals",
299355
"kind": "interface",
356+
"locationInModule": {
357+
"filename": "lib/index.ts",
358+
"line": 84
359+
},
300360
"name": "StructWithOnlyOptionals",
301361
"properties": [
302362
{
@@ -305,6 +365,10 @@
305365
"summary": "The first optional!"
306366
},
307367
"immutable": true,
368+
"locationInModule": {
369+
"filename": "lib/index.ts",
370+
"line": 88
371+
},
308372
"name": "optional1",
309373
"type": {
310374
"optional": true,
@@ -314,6 +378,10 @@
314378
{
315379
"abstract": true,
316380
"immutable": true,
381+
"locationInModule": {
382+
"filename": "lib/index.ts",
383+
"line": 89
384+
},
317385
"name": "optional2",
318386
"type": {
319387
"optional": true,
@@ -323,6 +391,10 @@
323391
{
324392
"abstract": true,
325393
"immutable": true,
394+
"locationInModule": {
395+
"filename": "lib/index.ts",
396+
"line": 90
397+
},
326398
"name": "optional3",
327399
"type": {
328400
"optional": true,
@@ -345,11 +417,19 @@
345417
"initializer": true
346418
},
347419
"kind": "class",
420+
"locationInModule": {
421+
"filename": "lib/index.ts",
422+
"line": 6
423+
},
348424
"methods": [
349425
{
350426
"docs": {
351427
"summary": "String representation of the value."
352428
},
429+
"locationInModule": {
430+
"filename": "lib/index.ts",
431+
"line": 15
432+
},
353433
"name": "toString",
354434
"returns": {
355435
"primitive": "string"
@@ -364,6 +444,10 @@
364444
"summary": "The value."
365445
},
366446
"immutable": true,
447+
"locationInModule": {
448+
"filename": "lib/index.ts",
449+
"line": 10
450+
},
367451
"name": "value",
368452
"type": {
369453
"primitive": "number"
@@ -373,5 +457,5 @@
373457
}
374458
},
375459
"version": "0.8.2",
376-
"fingerprint": "SDQQzBvYRO3SXfWWgpKwLDSy3EgMqP/e6rd75kblKA0="
460+
"fingerprint": "2SedGkpowEeJlL9PQ73/9LzRqzty2BGz+4bEsbOVlYU="
377461
}

0 commit comments

Comments
 (0)