Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(jsii): record source locations in assembly #429

Merged
merged 6 commits into from
Apr 4, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
rix0rrr marked this conversation as resolved.
Show resolved Hide resolved
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build",
"path": "packages/jsii/",
"problemMatcher": [
"$tsc"
]
}
]
}
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 @@ -47,24 +47,40 @@
"kind": "class",
"methods": [
{
"moduleLocation": {
"filename": "lib/index.ts",
"line": 6
},
"name": "hey",
"returns": {
"primitive": "number"
}
}
],
"moduleLocation": {
"filename": "lib/index.ts",
"line": 5
},
"name": "Very"
},
"@scope/jsii-calc-base-of-base.VeryBaseProps": {
"assembly": "@scope/jsii-calc-base-of-base",
"datatype": true,
"fqn": "@scope/jsii-calc-base-of-base.VeryBaseProps",
"kind": "interface",
"moduleLocation": {
"filename": "lib/index.ts",
"line": 1
},
"name": "VeryBaseProps",
"properties": [
{
"abstract": true,
"immutable": true,
"moduleLocation": {
"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": "ChnT8cvAK89dnGo5tWtBzckGsL+XJdxcTWz5U9GaOis="
}
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 @@ -80,12 +80,20 @@
"docs": {
"returns": "the name of the class (to verify native type names are created for derived classes)."
},
"moduleLocation": {
"filename": "lib/index.ts",
"line": 10
},
"name": "typeName",
"returns": {
"primitive": "any"
}
}
],
"moduleLocation": {
"filename": "lib/index.ts",
"line": 6
},
"name": "Base"
},
"@scope/jsii-calc-base.BaseProps": {
Expand All @@ -98,11 +106,19 @@
}
],
"kind": "interface",
"moduleLocation": {
"filename": "lib/index.ts",
"line": 15
},
"name": "BaseProps",
"properties": [
{
"abstract": true,
"immutable": true,
"moduleLocation": {
"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": "NbR4BtNxFD0grH5WVobm2xvna+aZDB9T1BErc/HLOns="
}
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 @@ -105,6 +105,10 @@
"name": "Value2"
}
],
"moduleLocation": {
"filename": "lib/index.ts",
"line": 97
},
"name": "EnumFromScopedModule"
},
"@scope/jsii-calc-lib.IDoublable": {
Expand All @@ -114,11 +118,19 @@
},
"fqn": "@scope/jsii-calc-lib.IDoublable",
"kind": "interface",
"moduleLocation": {
"filename": "lib/index.ts",
"line": 23
},
"name": "IDoublable",
"properties": [
{
"abstract": true,
"immutable": true,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 24
},
"name": "doubleValue",
"type": {
"primitive": "number"
Expand All @@ -140,12 +152,20 @@
"docs": {
"summary": "Say hello!"
},
"moduleLocation": {
"filename": "lib/index.ts",
"line": 62
},
"name": "hello",
"returns": {
"primitive": "string"
}
}
],
"moduleLocation": {
"filename": "lib/index.ts",
"line": 58
},
"name": "IFriendly"
},
"@scope/jsii-calc-lib.MyFirstStruct": {
Expand All @@ -156,6 +176,10 @@
},
"fqn": "@scope/jsii-calc-lib.MyFirstStruct",
"kind": "interface",
"moduleLocation": {
"filename": "lib/index.ts",
"line": 68
},
"name": "MyFirstStruct",
"properties": [
{
Expand All @@ -164,6 +188,10 @@
"summary": "An awesome number value."
},
"immutable": true,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 77
},
"name": "anumber",
"type": {
"primitive": "number"
Expand All @@ -175,6 +203,10 @@
"summary": "A string value."
},
"immutable": true,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 72
},
"name": "astring",
"type": {
"primitive": "string"
Expand All @@ -183,6 +215,10 @@
{
"abstract": true,
"immutable": true,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 78
},
"name": "firstOptional",
"type": {
"collection": {
Expand Down Expand Up @@ -228,13 +264,21 @@
}
],
"kind": "class",
"moduleLocation": {
"filename": "lib/index.ts",
"line": 30
},
"name": "Number",
"properties": [
{
"docs": {
"summary": "The number multiplied by 2."
},
"immutable": true,
"moduleLocation": {
"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,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 35
},
"name": "value",
"overrides": {
"fqn": "@scope/jsii-calc-lib.Value"
Expand Down Expand Up @@ -278,6 +326,10 @@
"docs": {
"summary": "String representation of the value."
},
"moduleLocation": {
"filename": "lib/index.ts",
"line": 51
},
"name": "toString",
"overrides": {
"fqn": "@scope/jsii-calc-lib.Value"
Expand All @@ -287,6 +339,10 @@
}
}
],
"moduleLocation": {
"filename": "lib/index.ts",
"line": 50
},
"name": "Operation"
},
"@scope/jsii-calc-lib.StructWithOnlyOptionals": {
Expand All @@ -297,6 +353,10 @@
},
"fqn": "@scope/jsii-calc-lib.StructWithOnlyOptionals",
"kind": "interface",
"moduleLocation": {
"filename": "lib/index.ts",
"line": 84
},
"name": "StructWithOnlyOptionals",
"properties": [
{
Expand All @@ -305,6 +365,10 @@
"summary": "The first optional!"
},
"immutable": true,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 88
},
"name": "optional1",
"type": {
"optional": true,
Expand All @@ -314,6 +378,10 @@
{
"abstract": true,
"immutable": true,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 89
},
"name": "optional2",
"type": {
"optional": true,
Expand All @@ -323,6 +391,10 @@
{
"abstract": true,
"immutable": true,
"moduleLocation": {
"filename": "lib/index.ts",
"line": 90
},
"name": "optional3",
"type": {
"optional": true,
Expand Down Expand Up @@ -350,12 +422,20 @@
"docs": {
"summary": "String representation of the value."
},
"moduleLocation": {
"filename": "lib/index.ts",
"line": 15
},
"name": "toString",
"returns": {
"primitive": "string"
}
}
],
"moduleLocation": {
"filename": "lib/index.ts",
"line": 6
},
"name": "Value",
"properties": [
{
Expand All @@ -364,6 +444,10 @@
"summary": "The value."
},
"immutable": true,
"moduleLocation": {
"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": "c/1unn4fiBe1mwhGWvCqeuG6d56DfwKFopFVpWj4CKE="
}
Loading