Skip to content

Commit

Permalink
feat(jsii): record source locations in assembly (#429)
Browse files Browse the repository at this point in the history
  • Loading branch information
rix0rrr authored Apr 4, 2019
1 parent 265c304 commit e601c0c
Show file tree
Hide file tree
Showing 22 changed files with 4,102 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ tsconfig.tsbuildinfo
.idea
.vs
/dist
.vscode
18 changes: 17 additions & 1 deletion packages/jsii-calc-base-of-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@
"initializer": true
},
"kind": "class",
"locationInModule": {
"filename": "lib/index.ts",
"line": 5
},
"methods": [
{
"locationInModule": {
"filename": "lib/index.ts",
"line": 6
},
"name": "hey",
"returns": {
"primitive": "number"
Expand All @@ -60,11 +68,19 @@
"datatype": true,
"fqn": "@scope/jsii-calc-base-of-base.VeryBaseProps",
"kind": "interface",
"locationInModule": {
"filename": "lib/index.ts",
"line": 1
},
"name": "VeryBaseProps",
"properties": [
{
"abstract": true,
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 2
},
"name": "foo",
"type": {
"fqn": "@scope/jsii-calc-base-of-base.Very"
Expand All @@ -74,5 +90,5 @@
}
},
"version": "0.8.2",
"fingerprint": "II5j+yUrBn6dB/gWFSs9fbCeaOJTu2szjv0xtMpkn80="
"fingerprint": "2FCIfxrvj5VhyzTpKaFKTg5dD0ix1DAx3o9DdB38894="
}
18 changes: 17 additions & 1 deletion packages/jsii-calc-base/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,19 @@
"initializer": true
},
"kind": "class",
"locationInModule": {
"filename": "lib/index.ts",
"line": 6
},
"methods": [
{
"docs": {
"returns": "the name of the class (to verify native type names are created for derived classes)."
},
"locationInModule": {
"filename": "lib/index.ts",
"line": 10
},
"name": "typeName",
"returns": {
"primitive": "any"
Expand All @@ -98,11 +106,19 @@
}
],
"kind": "interface",
"locationInModule": {
"filename": "lib/index.ts",
"line": 15
},
"name": "BaseProps",
"properties": [
{
"abstract": true,
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 16
},
"name": "bar",
"type": {
"primitive": "string"
Expand All @@ -112,5 +128,5 @@
}
},
"version": "0.8.2",
"fingerprint": "lIcHicx5rBBxyy5vOvOqvbBGjk//8lFLX6oVx2xh5Fc="
"fingerprint": "ZlEGeLVGfz+JP26QXUzhkZu/rJWK5niWhhadMxfwA40="
}
86 changes: 85 additions & 1 deletion packages/jsii-calc-lib/test/assembly.jsii
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
},
"fqn": "@scope/jsii-calc-lib.EnumFromScopedModule",
"kind": "enum",
"locationInModule": {
"filename": "lib/index.ts",
"line": 97
},
"members": [
{
"name": "Value1"
Expand All @@ -114,11 +118,19 @@
},
"fqn": "@scope/jsii-calc-lib.IDoublable",
"kind": "interface",
"locationInModule": {
"filename": "lib/index.ts",
"line": 23
},
"name": "IDoublable",
"properties": [
{
"abstract": true,
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 24
},
"name": "doubleValue",
"type": {
"primitive": "number"
Expand All @@ -134,12 +146,20 @@
},
"fqn": "@scope/jsii-calc-lib.IFriendly",
"kind": "interface",
"locationInModule": {
"filename": "lib/index.ts",
"line": 58
},
"methods": [
{
"abstract": true,
"docs": {
"summary": "Say hello!"
},
"locationInModule": {
"filename": "lib/index.ts",
"line": 62
},
"name": "hello",
"returns": {
"primitive": "string"
Expand All @@ -156,6 +176,10 @@
},
"fqn": "@scope/jsii-calc-lib.MyFirstStruct",
"kind": "interface",
"locationInModule": {
"filename": "lib/index.ts",
"line": 68
},
"name": "MyFirstStruct",
"properties": [
{
Expand All @@ -164,6 +188,10 @@
"summary": "An awesome number value."
},
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 77
},
"name": "anumber",
"type": {
"primitive": "number"
Expand All @@ -175,6 +203,10 @@
"summary": "A string value."
},
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 72
},
"name": "astring",
"type": {
"primitive": "string"
Expand All @@ -183,6 +215,10 @@
{
"abstract": true,
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 78
},
"name": "firstOptional",
"type": {
"collection": {
Expand Down Expand Up @@ -228,13 +264,21 @@
}
],
"kind": "class",
"locationInModule": {
"filename": "lib/index.ts",
"line": 30
},
"name": "Number",
"properties": [
{
"docs": {
"summary": "The number multiplied by 2."
},
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 42
},
"name": "doubleValue",
"overrides": {
"fqn": "@scope/jsii-calc-lib.IDoublable"
Expand All @@ -248,6 +292,10 @@
"summary": "The number."
},
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 35
},
"name": "value",
"overrides": {
"fqn": "@scope/jsii-calc-lib.Value"
Expand All @@ -272,12 +320,20 @@
"initializer": true
},
"kind": "class",
"locationInModule": {
"filename": "lib/index.ts",
"line": 50
},
"methods": [
{
"abstract": true,
"docs": {
"summary": "String representation of the value."
},
"locationInModule": {
"filename": "lib/index.ts",
"line": 51
},
"name": "toString",
"overrides": {
"fqn": "@scope/jsii-calc-lib.Value"
Expand All @@ -297,6 +353,10 @@
},
"fqn": "@scope/jsii-calc-lib.StructWithOnlyOptionals",
"kind": "interface",
"locationInModule": {
"filename": "lib/index.ts",
"line": 84
},
"name": "StructWithOnlyOptionals",
"properties": [
{
Expand All @@ -305,6 +365,10 @@
"summary": "The first optional!"
},
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 88
},
"name": "optional1",
"type": {
"optional": true,
Expand All @@ -314,6 +378,10 @@
{
"abstract": true,
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 89
},
"name": "optional2",
"type": {
"optional": true,
Expand All @@ -323,6 +391,10 @@
{
"abstract": true,
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 90
},
"name": "optional3",
"type": {
"optional": true,
Expand All @@ -345,11 +417,19 @@
"initializer": true
},
"kind": "class",
"locationInModule": {
"filename": "lib/index.ts",
"line": 6
},
"methods": [
{
"docs": {
"summary": "String representation of the value."
},
"locationInModule": {
"filename": "lib/index.ts",
"line": 15
},
"name": "toString",
"returns": {
"primitive": "string"
Expand All @@ -364,6 +444,10 @@
"summary": "The value."
},
"immutable": true,
"locationInModule": {
"filename": "lib/index.ts",
"line": 10
},
"name": "value",
"type": {
"primitive": "number"
Expand All @@ -373,5 +457,5 @@
}
},
"version": "0.8.2",
"fingerprint": "SDQQzBvYRO3SXfWWgpKwLDSy3EgMqP/e6rd75kblKA0="
"fingerprint": "2SedGkpowEeJlL9PQ73/9LzRqzty2BGz+4bEsbOVlYU="
}
Loading

0 comments on commit e601c0c

Please sign in to comment.