From ae85aa5aca90fd4038d34e2432beb128e559461c Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Mon, 15 Apr 2019 13:07:56 +0200 Subject: [PATCH] fix(dotnet): fix doc comment model parsing in .NET generator (#455) Mirror the changes to assembly docs model in the separate model that the .NET generator maintains. This fixes the crash that happens when parsing a model with custom doc attributes. Add compliance test to prevent this from happening again. --- packages/jsii-calc/lib/compliance.ts | 19 +++++ packages/jsii-calc/test/assembly.jsii | 24 +++++- .../Class/AbstractClassProxyGeneratorTests.cs | 3 +- .../Class/ClassGeneratorTests.cs | 3 +- .../Class/ClassMethodGeneratorTests.cs | 3 +- .../Class/ClassPropertyGeneratorTests.cs | 3 +- .../EnumMemberDocCommentGeneratorTests.cs | 47 ++++++------ .../MethodDocCommentGeneratorTests.cs | 75 +++++++++---------- .../PropertyDocCommentGeneratorTests.cs | 69 +++++++++++------ .../TypeDocCommentGeneratorTests.cs | 47 ++++++------ .../Enum/EnumGeneratorTests.cs | 18 ++--- .../Interface/InterfaceProxyGeneratorTests.cs | 5 +- .../InterfaceProxyMethodGeneratorTests.cs | 3 +- .../MethodExtensionsTests.cs | 5 +- .../DocComment/DocCommentGeneratorBase.cs | 40 +++++----- .../DocComment/MethodDocCommentGenerator.cs | 16 +--- .../Spec/AssemblyTests.cs | 12 +-- .../Spec/ClassTypeTests.cs | 6 +- .../Spec/DocsTests.cs | 26 +++++-- .../Spec/EnumMemberTests.cs | 4 +- .../src/Amazon.JSII.JsonModel/Spec/Docs.cs | 65 +++++++++++++++- .../Amazon.JSII.JsonModel/Spec/Stability.cs | 12 +++ .../.jsii | 24 +++++- .../CalculatorNamespace/ClassWithDocs.cs | 33 ++++++++ .../CalculatorNamespace/DocumentedClass.cs | 4 +- .../ILoadBalancedFargateServiceProps.cs | 6 +- .../LoadBalancedFargateServiceProps.cs | 6 +- .../LoadBalancedFargateServicePropsProxy.cs | 6 +- ...ReturnsPrivateImplementationOfInterface.cs | 2 +- .../amazon/jsii/tests/calculator/$Module.java | 1 + .../jsii/tests/calculator/ClassWithDocs.java | 26 +++++++ .../python/src/jsii_calc/__init__.py | 7 +- .../expected.jsii-calc/sphinx/jsii-calc.rst | 37 +++++++++ .../jsii-reflect/test/classes.expected.txt | 1 + .../test/jsii-tree.test.all.expected.txt | 3 + .../jsii-tree.test.inheritance.expected.txt | 1 + .../test/jsii-tree.test.members.expected.txt | 3 + .../test/jsii-tree.test.types.expected.txt | 1 + 38 files changed, 476 insertions(+), 190 deletions(-) create mode 100644 packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Stability.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithDocs.cs create mode 100644 packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ClassWithDocs.java diff --git a/packages/jsii-calc/lib/compliance.ts b/packages/jsii-calc/lib/compliance.ts index 31d30e3ca0..a01d9808a1 100644 --- a/packages/jsii-calc/lib/compliance.ts +++ b/packages/jsii-calc/lib/compliance.ts @@ -1617,3 +1617,22 @@ export class OptionalStructConsumer { export interface OptionalStruct { readonly field?: string; } + + +/** + * This class has docs. + * + * The docs are great. They're a bunch of tags. + * + * @example + * + * function anExample() { + * } + * + * @see https://aws.amazon.com/ + * @customAttribute hasAValue + * @deprecated Use something else please + * @stable + */ +export class ClassWithDocs { +} \ No newline at end of file diff --git a/packages/jsii-calc/test/assembly.jsii b/packages/jsii-calc/test/assembly.jsii index 65fedf4d0d..fa4dfbcaee 100644 --- a/packages/jsii-calc/test/assembly.jsii +++ b/packages/jsii-calc/test/assembly.jsii @@ -1506,6 +1506,28 @@ } ] }, + "jsii-calc.ClassWithDocs": { + "assembly": "jsii-calc", + "docs": { + "custom": { + "customAttribute": "hasAValue" + }, + "deprecated": "Use something else please", + "example": "function anExample() {\n}", + "remarks": "The docs are great. They're a bunch of tags.", + "see": "https://aws.amazon.com/", + "stability": "stable", + "summary": "This class has docs." + }, + "fqn": "jsii-calc.ClassWithDocs", + "initializer": {}, + "kind": "class", + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 1637 + }, + "name": "ClassWithDocs" + }, "jsii-calc.ClassWithMutableObjectLiteralProperty": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassWithMutableObjectLiteralProperty", @@ -6637,5 +6659,5 @@ } }, "version": "0.9.0", - "fingerprint": "Lg8wDjQSsRLa2sk8EriArt/u5aibYilCuYFRZHh02Eg=" + "fingerprint": "F319lrdZvWrVwdgKTX3nSjnYs1YghHSnYqGopWs2N+0=" } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs index 1b0255d3c7..aa94abb45d 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/AbstractClassProxyGeneratorTests.cs @@ -1,6 +1,7 @@ using Amazon.JSII.Generator.Class; using Amazon.JSII.JsonModel.Spec; using Xunit; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.Class { @@ -58,7 +59,7 @@ public void IncludesDocs() name: "myClass", isAbstract: true, initializer: new Initializer(), - docs: new Docs {{"foo", "bar"}} + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ); string actual = Render(classType); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs index 642cb1847c..b4fe4d7caa 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassGeneratorTests.cs @@ -3,6 +3,7 @@ using Microsoft.CodeAnalysis; using Xunit; using TypeKind = Amazon.JSII.JsonModel.Spec.TypeKind; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.Class { @@ -133,7 +134,7 @@ public void IncludesDocs() name: "myClass", isAbstract: false, initializer: new Initializer(), - docs: new Docs {{"foo", "bar"}} + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ); string actual = Render(classType); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs index e8dd66c21c..204b1e44f3 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassMethodGeneratorTests.cs @@ -3,6 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using Xunit; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.Class { @@ -114,7 +115,7 @@ public void DoesNotIncludeDocs() Method method = new Method ( name: "myMethod", - docs: new Docs { { "foo", "bar" } } + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ); Symbols.MapMethodName("myClassFqn", "myMethod", "MyMethod"); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs index 31e8299177..7b4fc3b06f 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Class/ClassPropertyGeneratorTests.cs @@ -3,6 +3,7 @@ using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; using Xunit; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.Class { @@ -198,7 +199,7 @@ public void DoesNotIncludeDocs() isImmutable: true, isAbstract: false, isProtected: false, - docs: new Docs { { "foo", "bar" } } + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ); Symbols.MapPropertyName("myClassFqn", "myProperty", "MyProperty"); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/EnumMemberDocCommentGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/EnumMemberDocCommentGeneratorTests.cs index 3afd503356..18215a7d2a 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/EnumMemberDocCommentGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/EnumMemberDocCommentGeneratorTests.cs @@ -3,6 +3,7 @@ using Microsoft.CodeAnalysis; using Xunit; using SF = Microsoft.CodeAnalysis.CSharp.SyntaxFactory; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.DocComment { @@ -29,9 +30,9 @@ string Render(Docs docs) public void IncludesSingleLineSummary() { Docs docs = new Docs - { - { "summary", "my comment" } - }; + ( + summary: "my comment" + ); string actual = Render(docs); string expected = @@ -47,9 +48,9 @@ public void IncludesSingleLineSummary() public void IncludesMultiLineSummary(string summary) { Docs docs = new Docs - { - { "summary", summary } - }; + ( + summary: summary + ); string actual = Render(docs); string expected = @@ -66,9 +67,9 @@ public void IncludesMultiLineSummary(string summary) public void IncludesSingleLineRemarks() { Docs docs = new Docs - { - { "myKey", "my comment" } - }; + ( + custom: new Dictionary{{ "myKey", "my comment" }} + ); string actual = Render(docs); string expected = @@ -82,10 +83,12 @@ public void IncludesSingleLineRemarks() public void IncludesMultiLineRemarks() { Docs docs = new Docs - { - { "myKey1", "my\ncomment" }, - { "myKey2", "my\r\ncomment" } - }; + ( + custom: new Dictionary{ + { "myKey1", "my\ncomment" }, + { "myKey2", "my\r\ncomment" } + } + ); string actual = Render(docs); string expected = @@ -104,9 +107,9 @@ public void IncludesMultiLineRemarks() public void SeparatesSingleLineLink() { Docs docs = new Docs - { - { "link", "www.example.com" } - }; + ( + custom: new Dictionary{{ "link", "www.example.com" }} + ); string actual = Render(docs); string expected = @@ -120,9 +123,9 @@ public void SeparatesSingleLineLink() public void IgnoresParam() { Docs docs = new Docs - { - { "param", "my comment" } - }; + ( + custom: new Dictionary{{ "param", "my comment" }} + ); string actual = Render(docs); string expected = @"Member"; @@ -134,9 +137,9 @@ public void IgnoresParam() public void IgnoresReturns() { Docs docs = new Docs - { - { "returns", "my comment" } - }; + ( + returns: "my comment" + ); string actual = Render(docs); string expected = @"Member"; diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs index 2bb44e73f1..2e49a4827c 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/MethodDocCommentGeneratorTests.cs @@ -3,6 +3,7 @@ using Microsoft.CodeAnalysis; using Xunit; using SF = Microsoft.CodeAnalysis.CSharp.SyntaxFactory; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.DocComment { @@ -34,9 +35,9 @@ string Render(Docs docs, params Parameter[] parameters) public void IncludesSingleLineSummary() { Docs docs = new Docs - { - { "summary", "my comment" } - }; + ( + summary: "my comment" + ); string actual = Render(docs); string expected = @@ -52,9 +53,9 @@ public void IncludesSingleLineSummary() public void IncludesMultiLineSummary(string summary) { Docs docs = new Docs - { - { "summary", summary } - }; + ( + summary: summary + ); string actual = Render(docs); string expected = @@ -71,9 +72,9 @@ public void IncludesMultiLineSummary(string summary) public void IncludesSingleLineRemarks() { Docs docs = new Docs - { - { "myKey", "my comment" } - }; + ( + custom: new Dictionary{{ "myKey", "my comment" }} + ); string actual = Render(docs); string expected = @@ -87,10 +88,12 @@ public void IncludesSingleLineRemarks() public void IncludesMultiLineRemarks() { Docs docs = new Docs - { - { "myKey1", "my\ncomment" }, - { "myKey2", "my\r\ncomment" } - }; + ( + custom: new Dictionary{ + { "myKey1", "my\ncomment" }, + { "myKey2", "my\r\ncomment" } + } + ); string actual = Render(docs); string expected = @@ -109,9 +112,9 @@ public void IncludesMultiLineRemarks() public void SeparatesSingleLineLink() { Docs docs = new Docs - { - { "link", "www.example.com" } - }; + ( + custom: new Dictionary{ { "link", "www.example.com" } } + ); string actual = Render(docs); string expected = @@ -125,9 +128,9 @@ public void SeparatesSingleLineLink() public void IgnoresParam() { Docs docs = new Docs - { - { "param", "my comment" } - }; + ( + custom: new Dictionary{ { "param", "my comment" } } + ); string actual = Render(docs); string expected = @"void Method()"; @@ -139,9 +142,9 @@ public void IgnoresParam() public void IncludesReturns() { Docs docs = new Docs - { - { "returns", "my comment" } - }; + ( + returns: "my comment" + ); string actual = Render(docs); string expected = @@ -158,9 +161,9 @@ public void IgnoresParameterParam() name: "myParam", type: new TypeReference(primitive: PrimitiveType.String), docs: new Docs - { - { "param", "my comment" } - } + ( + custom: new Dictionary{ { "param", "my comment" } } + ) ); Symbols.MapParameterName("myParam", "myParam"); @@ -178,9 +181,9 @@ public void TrimsParameterSummary() name: "myParam", type: new TypeReference(primitive: PrimitiveType.String), docs: new Docs - { - { "summary", "my comment" } - } + ( + summary: "my comment" + ) ); Symbols.MapParameterName("myParam", "myParam"); @@ -193,27 +196,23 @@ public void TrimsParameterSummary() Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); } - [Fact(DisplayName = Prefix + nameof(IncludesParameterRemarks))] - public void IncludesParameterRemarks() + [Fact(DisplayName = Prefix + nameof(IncludesParameterSummary))] + public void IncludesParameterSummary() { Parameter parameter = new Parameter( name: "myParam", type: new TypeReference(primitive: PrimitiveType.String), docs: new Docs - { - { "myKey1", "my comment" }, - { "myKey2", "my comment" } - } + ( + summary: "This parameter is swell" + ) ); Symbols.MapParameterName("myParam", "myParam"); string actual = Render(null, parameter); string expected = -@"/// -/// myKey1: my comment -/// myKey2: my comment -/// +@"/// This parameter is swell void Method()"; Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs index a87cfd74c6..9f9608983d 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/PropertyDocCommentGeneratorTests.cs @@ -3,6 +3,7 @@ using Microsoft.CodeAnalysis; using Xunit; using SF = Microsoft.CodeAnalysis.CSharp.SyntaxFactory; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.DocComment { @@ -37,9 +38,9 @@ string Render(Docs docs) public void IncludesSingleLineSummary() { Docs docs = new Docs - { - { "summary", "my comment" } - }; + ( + summary: "my comment" + ); string actual = Render(docs); string expected = @@ -55,9 +56,9 @@ public void IncludesSingleLineSummary() public void IncludesMultiLineSummary(string summary) { Docs docs = new Docs - { - { "summary", summary } - }; + ( + summary: summary + ); string actual = Render(docs); string expected = @@ -74,9 +75,9 @@ public void IncludesMultiLineSummary(string summary) public void IncludesSingleLineRemarks() { Docs docs = new Docs - { - { "myKey", "my comment" } - }; + ( + custom: new Dictionary{{ "myKey", "my comment" }} + ); string actual = Render(docs); string expected = @@ -90,10 +91,12 @@ public void IncludesSingleLineRemarks() public void IncludesMultiLineRemarks() { Docs docs = new Docs - { - { "myKey1", "my\ncomment" }, - { "myKey2", "my\r\ncomment" } - }; + ( + custom: new Dictionary{ + { "myKey1", "my\ncomment" }, + { "myKey2", "my\r\ncomment" } + } + ); string actual = Render(docs); string expected = @@ -112,9 +115,9 @@ public void IncludesMultiLineRemarks() public void SeparatesSingleLineLink() { Docs docs = new Docs - { - { "link", "www.example.com" } - }; + ( + custom: new Dictionary{{"link", "www.example.com" }} + ); string actual = Render(docs); string expected = @@ -128,9 +131,9 @@ public void SeparatesSingleLineLink() public void IgnoresParam() { Docs docs = new Docs - { - { "param", "my comment" } - }; + ( + custom: new Dictionary{{"param", "my comment" }} + ); string actual = Render(docs); string expected = @"string MyProp"; @@ -142,9 +145,9 @@ public void IgnoresParam() public void IncludesReturns() { Docs docs = new Docs - { - { "returns", "my comment" } - }; + ( + returns: "my comment" + ); string actual = Render(docs); string expected = @@ -153,5 +156,27 @@ public void IncludesReturns() Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); } + + [Fact(DisplayName = Prefix + nameof(ShowsDefault))] + public void ShowsDefault() + { + Docs docs = new Docs + ( + summary: "A property", + remarks: "Some remarks.", + @default: "Tis a default" + ); + + string actual = Render(docs); + string expected = +@"/// A property +/// +/// Some remarks. +/// default: Tis a default +/// + string MyProp"; + + Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); + } } } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/TypeDocCommentGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/TypeDocCommentGeneratorTests.cs index 38e22b1d85..638272854e 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/TypeDocCommentGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/DocComment/TypeDocCommentGeneratorTests.cs @@ -2,6 +2,7 @@ using Amazon.JSII.JsonModel.Spec; using Microsoft.CodeAnalysis; using Xunit; +using System.Collections.Generic; using SF = Microsoft.CodeAnalysis.CSharp.SyntaxFactory; namespace Amazon.JSII.Generator.UnitTests.DocComment @@ -36,9 +37,9 @@ string Render(Docs docs) public void IncludesSingleLineSummary() { Docs docs = new Docs - { - { "summary", "my comment" } - }; + ( + summary: "my comment" + ); string actual = Render(docs); string expected = @@ -56,9 +57,9 @@ interface MyInterface public void IncludesMultiLineSummary(string summary) { Docs docs = new Docs - { - { "summary", summary } - }; + ( + summary: summary + ); string actual = Render(docs); string expected = @@ -77,9 +78,9 @@ interface MyInterface public void IncludesSingleLineRemarks() { Docs docs = new Docs - { - { "myKey", "my comment" } - }; + ( + custom: new Dictionary{{ "myKey", "my comment" }} + ); string actual = Render(docs); string expected = @@ -95,10 +96,12 @@ interface MyInterface public void IncludesMultiLineRemarks() { Docs docs = new Docs - { - { "myKey1", "my\ncomment" }, - { "myKey2", "my\r\ncomment" } - }; + ( + custom: new Dictionary{ + { "myKey1", "my\ncomment" }, + { "myKey2", "my\r\ncomment" } + } + ); string actual = Render(docs); string expected = @@ -119,9 +122,9 @@ interface MyInterface public void SeparatesSingleLineLink() { Docs docs = new Docs - { - { "link", "www.example.com" } - }; + ( + custom: new Dictionary{ { "link", "www.example.com" } } + ); string actual = Render(docs); string expected = @@ -137,9 +140,9 @@ interface MyInterface public void IgnoresParam() { Docs docs = new Docs - { - { "param", "my comment" } - }; + ( + custom: new Dictionary{ { "param", "my comment" } } + ); string actual = Render(docs); string expected = @@ -154,9 +157,9 @@ public void IgnoresParam() public void IgnoresReturns() { Docs docs = new Docs - { - { "returns", "my comment" } - }; + ( + returns: "my comment" + ); string actual = Render(docs); string expected = diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs index 45fca21661..55f4606cbd 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Enum/EnumGeneratorTests.cs @@ -3,6 +3,7 @@ using Amazon.JSII.JsonModel.Spec; using Microsoft.CodeAnalysis; using Xunit; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.Enum { @@ -27,8 +28,8 @@ public void IncludesAttribute() { EnumType enumType = new EnumType ( - fullyQualifiedName: "myEnumFqn", - assembly: "myPackage", + fullyQualifiedName: "myEnumFqn", + assembly: "myPackage", name: "myEnum", members: new EnumMember[] { } ); @@ -50,8 +51,8 @@ public void IncludesMembers() { EnumType enumType = new EnumType ( - fullyQualifiedName: "myEnumFqn", - assembly: "myPackage", + fullyQualifiedName: "myEnumFqn", + assembly: "myPackage", name: "myEnum", members: new EnumMember[] { @@ -88,10 +89,7 @@ public void IncludesDocs() assembly: "myPackage", name: "myEnum", members: new EnumMember[] { }, - docs: new Docs - { - { "foo", "bar" } - } + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ); string actual = Render(enumType); @@ -117,8 +115,8 @@ public void IncludesMemberDocs() name: "myEnum", members: new EnumMember[] { - new EnumMember("member1", new Docs { { "foo", "bar" } }), - new EnumMember("member2", new Docs { { "foo", "bar" } }), + new EnumMember("member1", docs: new Docs(custom: new Dictionary{{"foo", "bar"}})), + new EnumMember("member2", docs: new Docs(custom: new Dictionary{{"foo", "bar"}})) } ); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs index 2e66a460a2..57e6cd6ed6 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyGeneratorTests.cs @@ -4,6 +4,7 @@ using Newtonsoft.Json; using Xunit; using TypeKind = Amazon.JSII.JsonModel.Spec.TypeKind; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.Interface { @@ -160,7 +161,7 @@ public void IncludesDocs() "myPackage", "myInterface", "myNamespace", - docs: new Docs {{"foo", "bar"}} + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ); string actual = Render(interfaceType); @@ -204,7 +205,7 @@ public void EnvironmentRegression() ""summary"": ""The 12-digit AWS account ID for the account this environment deploys into "" }, ""abstract"": true, - ""name"": ""account"", + ""name"": ""account"", ""type"": { ""primitive"": ""string"" } diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs index 666f2b2f37..e53cad895f 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/Interface/InterfaceProxyMethodGeneratorTests.cs @@ -4,6 +4,7 @@ using Microsoft.CodeAnalysis.CSharp.Syntax; using Xunit; using TypeKind = Amazon.JSII.JsonModel.Spec.TypeKind; +using System.Collections.Generic; namespace Amazon.JSII.Generator.UnitTests.Interface { @@ -83,7 +84,7 @@ public void DoesNotIncludeDocs() Method method = new Method ( isAbstract: true, name: "myMethod", - docs: new Docs { { "foo", "bar" } } + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ); Symbols.MapMethodName("myInterfaceFqn", "myMethod", "MyMethod"); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs index cbc9ef975d..664ba11307 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator.UnitTests/MethodExtensionsTests.cs @@ -1,6 +1,7 @@ using Amazon.JSII.JsonModel.Spec; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; +using System.Collections.Generic; using NSubstitute; using Xunit; @@ -117,13 +118,13 @@ public void StripsDocs() ( name: "myParam1", type: new TypeReference("myParamTypeFqn1"), - docs: new Docs { { "foo", "bar" } } + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ), new Parameter ( name: "myParam2", type: new TypeReference("myParamTypeFqn2"), - docs: new Docs { { "foo", "bar" } } + docs: new Docs(custom: new Dictionary{{"foo", "bar"}}) ) } ); diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs index 8bbd506b14..532b24a4dd 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/DocCommentGeneratorBase.cs @@ -14,10 +14,7 @@ public abstract class DocCommentGeneratorBase { static readonly ISet _wellKnownKeys = new HashSet(new[] { - "summary", "param", - "returns", - "custom", }); public DocCommentGeneratorBase(T documentable) @@ -39,10 +36,10 @@ public SyntaxTrivia CreateDocComment() protected IEnumerable GetSummaryNodes() { - if (Documentable.Docs?.ContainsKey("summary") ?? false) + if (!String.IsNullOrEmpty(Documentable.Docs?.Summary)) { yield return SF.XmlText(" ").WithLeadingTrivia(SF.DocumentationCommentExterior(" ")); - yield return SF.XmlSummaryElement(GetXmlNodes(Documentable.Docs["summary"]).ToArray()); + yield return SF.XmlSummaryElement(GetXmlNodes(Documentable.Docs.Summary).ToArray()); } } @@ -53,30 +50,37 @@ protected IEnumerable GetRemarksNodes() yield break; } - string remarks = string.Join(Environment.NewLine, Documentable.Docs + List remarks = new List(); + if (!String.IsNullOrEmpty(Documentable.Docs.Remarks)) { remarks.Add(Documentable.Docs.Remarks); } + if (!String.IsNullOrEmpty(Documentable.Docs.Default)) { remarks.Add($"default: {Documentable.Docs.Default}"); } + if (!String.IsNullOrEmpty(Documentable.Docs.Deprecated)) { remarks.Add($"deprecated: {Documentable.Docs.Deprecated}"); } + if (Documentable.Docs.Stability.HasValue) { remarks.Add($"stability: {Documentable.Docs.Stability}"); } + if (!String.IsNullOrEmpty(Documentable.Docs.Example)) { remarks.Add($"example:\n\n{Documentable.Docs.Example}\n"); } + if (!String.IsNullOrEmpty(Documentable.Docs.See)) { remarks.Add($"{Documentable.Docs.See} "); } // Extra space here to keep links clickable + if (Documentable.Docs.Subclassable.GetValueOrDefault(false)) { remarks.Add($"subclassable"); } + + remarks.AddRange(Documentable.Docs.Custom .Where(kvp => !_wellKnownKeys.Contains(kvp.Key)) - // Visual Studio will include the closing tag as part - // of the clickable link if there is no space separating it. - .Select(kvp => (kvp.Key != "remarks" ? kvp.Key + ": " : "") + $"{kvp.Value}{(kvp.Key == "link" ? " " : "")}")); + .Select(kvp => kvp.Key == "link" + ? $"{kvp.Key}: {kvp.Value} " // Extra space for '@link' to keep unit tests happy + : $"{kvp.Key}: {kvp.Value}" + )); if (remarks.Any()) { yield return SF.XmlText(" ").WithLeadingTrivia(SF.DocumentationCommentExterior(" ")); - yield return SF.XmlRemarksElement(GetXmlNodes(remarks).ToArray()); + yield return SF.XmlRemarksElement(GetXmlNodes(string.Join(Environment.NewLine, remarks)).ToArray()); } } protected IEnumerable GetReturnsNodes() { - if (Documentable.Docs?.ContainsKey("returns") != true) - { - yield break; - } + var text = Documentable.Docs?.Returns; - string text = Documentable.Docs["returns"]; - - yield return SF.XmlText(" ").WithLeadingTrivia(SF.DocumentationCommentExterior(" ")); - yield return SF.XmlReturnsElement(GetXmlNodes(text).ToArray()); + if (!String.IsNullOrEmpty(text)) { + yield return SF.XmlText(" ").WithLeadingTrivia(SF.DocumentationCommentExterior(" ")); + yield return SF.XmlReturnsElement(GetXmlNodes(text).ToArray()); + } } protected IEnumerable GetXmlNodes(string text) diff --git a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/MethodDocCommentGenerator.cs b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/MethodDocCommentGenerator.cs index c1aff0490a..78b645a68c 100644 --- a/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/MethodDocCommentGenerator.cs +++ b/packages/jsii-dotnet-generator/src/Amazon.JSII.Generator/DocComment/MethodDocCommentGenerator.cs @@ -54,21 +54,9 @@ IEnumerable GetParamsNodes() IEnumerable GetParamTextLines(Parameter parameter) { - foreach (KeyValuePair kvp in parameter.Docs) + if (!String.IsNullOrEmpty(parameter.Docs.Summary)) { - if (kvp.Key == "param") - { - continue; - } - - if (kvp.Key == "summary") - { - yield return kvp.Value; - } - else - { - yield return $"{kvp.Key}: {kvp.Value}"; - } + yield return parameter.Docs.Summary; } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs index 5e365cdceb..6779b2ef22 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/AssemblyTests.cs @@ -363,7 +363,7 @@ public void ShouldDeserializeAllMembers() ""types"": {}, ""dependencies"": {}, ""bundled"": {}, - ""docs"": {} + ""docs"": { ""summary"": ""hello"" } }"; Assembly actual = JsonConvert.DeserializeObject(json); @@ -375,7 +375,7 @@ public void ShouldDeserializeAllMembers() Assert.Empty(actual.Types); Assert.Empty(actual.Dependencies); Assert.Empty(actual.Bundled); - Assert.Empty(actual.Docs); + Assert.Equal("hello", actual.Docs.Summary); } [Fact(DisplayName = Prefix + nameof(ShouldDeserializeAllMembersWithNoTypes))] @@ -399,7 +399,7 @@ public void ShouldDeserializeAllMembersWithNoTypes() ""license"": """", ""dependencies"": {}, ""bundled"": {}, - ""docs"": {} + ""docs"": {""summary"": ""hello""} }"; Assembly actual = JsonConvert.DeserializeObject(json); @@ -411,7 +411,7 @@ public void ShouldDeserializeAllMembersWithNoTypes() Assert.Null(actual.Types); Assert.Empty(actual.Dependencies); Assert.Empty(actual.Bundled); - Assert.Empty(actual.Docs); + Assert.Equal("hello", actual.Docs.Summary); } @@ -447,7 +447,7 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() ""types"": {}, ""dependencies"": {}, ""bundled"": {}, - ""docs"": {} + ""docs"": {""summary"": ""hello""} }"; Assembly actual = JsonConvert.DeserializeObject(json); @@ -467,7 +467,7 @@ public void ShouldDeserializeAllMembersWithDotNetTarget() Assert.Empty(actual.Types); Assert.Empty(actual.Dependencies); Assert.Empty(actual.Bundled); - Assert.Empty(actual.Docs); + Assert.Equal("hello", actual.Docs.Summary); } [Fact(DisplayName = Prefix + nameof(ShouldThrowOnMissingName))] diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs index 84c75c4c55..e266fae302 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/ClassTypeTests.cs @@ -372,7 +372,7 @@ public void ShouldDeserializeAllMembers() ""name"": ""myName"", ""namespace"": ""myNamespace"", ""kind"": ""class"", - ""docs"": {} + ""docs"": { ""summary"": ""hello"" } }"; ClassType actual = JsonConvert.DeserializeObject(json); @@ -388,7 +388,7 @@ public void ShouldDeserializeAllMembers() Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); Assert.Equal("myNamespace", actual.Namespace, ignoreLineEndingDifferences: true); Assert.Equal(TypeKind.Class, actual.Kind); - Assert.Empty(actual.Docs); + Assert.Equal("hello", actual.Docs.Summary); } [Fact(DisplayName = Prefix + nameof(ShouldThrowOnMissingFullyQualifiedName))] @@ -603,7 +603,7 @@ public void ShouldNotDeserializeMissingInterfaces() Assert.Null(actual.Interfaces); } - + [Fact(DisplayName = Prefix + nameof(DeserializesAsyncMethod))] public void DeserializesAsyncMethod() { diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/DocsTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/DocsTests.cs index f05ce1c632..562ae45d07 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/DocsTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/DocsTests.cs @@ -1,6 +1,7 @@ using Amazon.JSII.JsonModel.Spec; using Newtonsoft.Json; using System; +using System.Collections.Generic; using Xunit; namespace Amazon.JSII.JsonModel.UnitTests.Spec @@ -16,14 +17,19 @@ public class Serialization [Fact(DisplayName = Prefix + nameof(ShouldSerializeAllMembers))] public void ShouldSerializeAllMembers() { - Docs docs = new Docs - { - { "myKey", "myValue" } - }; + Docs docs = new Docs( + "summary", + "remarks", + custom: new Dictionary{ { "custtag", "custval" } } + ); string actual = JsonConvert.SerializeObject(docs, Formatting.Indented); const string expected = @"{ - ""myKey"": ""myValue"" + ""custom"": { + ""custtag"": ""custval"" + }, + ""summary"": ""summary"", + ""remarks"": ""remarks"" }"; Assert.Equal(expected, actual, ignoreLineEndingDifferences: true); @@ -38,12 +44,18 @@ public class Deserialization public void ShouldDeserializeAllMembers() { const string json = @"{ - ""myKey"": ""myValue"" + ""summary"": ""summary"", + ""remarks"": ""remarks"", + ""default"": ""some default"", + ""custom"": { ""custtag"": ""custval"" } }"; Docs actual = JsonConvert.DeserializeObject(json); - Assert.Equal("myValue", actual["myKey"], ignoreLineEndingDifferences: true); + Assert.Equal("summary", actual.Summary); + Assert.Equal("remarks", actual.Remarks); + Assert.Equal("some default", actual.Default); + Assert.Equal("custval", actual.Custom["custtag"]); } } } diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/EnumMemberTests.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/EnumMemberTests.cs index 63ac747484..c3e43b6224 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/EnumMemberTests.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel.UnitTests/Spec/EnumMemberTests.cs @@ -56,13 +56,13 @@ public void ShouldDeserializeAllMembers() { const string json = @"{ ""name"": ""myName"", - ""docs"": {} + ""docs"": { ""summary"": ""hello"" } }"; EnumMember actual = JsonConvert.DeserializeObject(json); Assert.Equal("myName", actual.Name, ignoreLineEndingDifferences: true); - Assert.Empty(actual.Docs); + Assert.Equal("hello", actual.Docs.Summary); } [Fact(DisplayName = Prefix + nameof(ShouldThrowOnMissingName))] diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Docs.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Docs.cs index a49dfee4c0..1d020f8bdd 100644 --- a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Docs.cs +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Docs.cs @@ -1,9 +1,70 @@ using Newtonsoft.Json; +using System.Collections.Generic; namespace Amazon.JSII.JsonModel.Spec { - [JsonDictionary] - public class Docs : JsonDictionaryBase + [JsonObject(MemberSerialization = MemberSerialization.OptIn)] + public class Docs { + public Docs + ( + string summary = null, + string remarks = null, + string deprecated = null, + string returns = null, + Stability? stability = null, + string example = null, + string see = null, + bool? subclassable = null, + string @default = null, + IDictionary custom = null + ) + { + Summary = summary; + Remarks = remarks; + Deprecated = deprecated; + Returns = returns; + Stability = stability; + Example = example; + See = see; + Subclassable = subclassable; + Default = @default; + Custom = custom ?? new Dictionary(); + } + + [JsonProperty("summary", NullValueHandling = NullValueHandling.Ignore)] + public string Summary { get; } + + [JsonProperty("remarks", NullValueHandling = NullValueHandling.Ignore)] + public string Remarks { get; } + + [JsonProperty("deprecated", NullValueHandling = NullValueHandling.Ignore)] + public string Deprecated { get; } + + [JsonProperty("returns", NullValueHandling = NullValueHandling.Ignore)] + public string Returns { get; } + + [JsonProperty("stability", NullValueHandling = NullValueHandling.Ignore)] + public Stability? Stability { get; } + + [JsonProperty("example", NullValueHandling = NullValueHandling.Ignore)] + public string Example { get; } + + [JsonProperty("see", NullValueHandling = NullValueHandling.Ignore)] + public string See { get; } + + [JsonProperty("subclassable", NullValueHandling = NullValueHandling.Ignore)] + public bool? Subclassable { get; } + + [JsonProperty("default", NullValueHandling = NullValueHandling.Ignore)] + public string Default { get; } + + [JsonProperty("custom", NullValueHandling = NullValueHandling.Ignore)] + public IDictionary Custom; + + + public bool ShouldSerializeCustom() { + return Custom.Count > 0; + } } } \ No newline at end of file diff --git a/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Stability.cs b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Stability.cs new file mode 100644 index 0000000000..788dfb09c9 --- /dev/null +++ b/packages/jsii-dotnet-jsonmodel/src/Amazon.JSII.JsonModel/Spec/Stability.cs @@ -0,0 +1,12 @@ +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace Amazon.JSII.JsonModel.Spec +{ + [JsonConverter(typeof(StringEnumConverter), /* camelCaseText */ true)] + public enum Stability + { + Stable, + Experimental + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii index 65fedf4d0d..fa4dfbcaee 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/.jsii @@ -1506,6 +1506,28 @@ } ] }, + "jsii-calc.ClassWithDocs": { + "assembly": "jsii-calc", + "docs": { + "custom": { + "customAttribute": "hasAValue" + }, + "deprecated": "Use something else please", + "example": "function anExample() {\n}", + "remarks": "The docs are great. They're a bunch of tags.", + "see": "https://aws.amazon.com/", + "stability": "stable", + "summary": "This class has docs." + }, + "fqn": "jsii-calc.ClassWithDocs", + "initializer": {}, + "kind": "class", + "locationInModule": { + "filename": "lib/compliance.ts", + "line": 1637 + }, + "name": "ClassWithDocs" + }, "jsii-calc.ClassWithMutableObjectLiteralProperty": { "assembly": "jsii-calc", "fqn": "jsii-calc.ClassWithMutableObjectLiteralProperty", @@ -6637,5 +6659,5 @@ } }, "version": "0.9.0", - "fingerprint": "Lg8wDjQSsRLa2sk8EriArt/u5aibYilCuYFRZHh02Eg=" + "fingerprint": "F319lrdZvWrVwdgKTX3nSjnYs1YghHSnYqGopWs2N+0=" } diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithDocs.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithDocs.cs new file mode 100644 index 0000000000..cf642d45a0 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ClassWithDocs.cs @@ -0,0 +1,33 @@ +using Amazon.JSII.Runtime.Deputy; + +namespace Amazon.JSII.Tests.CalculatorNamespace +{ + /// This class has docs. + /// + /// The docs are great. They're a bunch of tags. + /// deprecated: Use something else please + /// stability: Stable + /// example: + /// <code> + /// function anExample() { + /// } + /// </code> + /// https://aws.amazon.com/ + /// customAttribute: hasAValue + /// + [JsiiClass(nativeType: typeof(ClassWithDocs), fullyQualifiedName: "jsii-calc.ClassWithDocs")] + public class ClassWithDocs : DeputyBase + { + public ClassWithDocs(): base(new DeputyProps(new object[]{})) + { + } + + protected ClassWithDocs(ByRefValue reference): base(reference) + { + } + + protected ClassWithDocs(DeputyProps props): base(props) + { + } + } +} \ No newline at end of file diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs index 27a8fb1742..e6e1ba0344 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/DocumentedClass.cs @@ -8,7 +8,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace /// multiple lines and multiple paragraphs. /// /// Multiple paragraphs are separated by an empty line. - /// stability: stable + /// stability: Stable /// [JsiiClass(nativeType: typeof(DocumentedClass), fullyQualifiedName: "jsii-calc.DocumentedClass")] public class DocumentedClass : DeputyBase @@ -39,7 +39,7 @@ public virtual double Greet(IGreetee greetee) } /// Say ¡Hola! - /// stability: experimental + /// stability: Experimental [JsiiMethod(name: "hola")] public virtual void Hola() { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs index 08cd8aa2f6..5a51fe4948 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ILoadBalancedFargateServiceProps.cs @@ -8,8 +8,8 @@ public interface ILoadBalancedFargateServiceProps { /// The container port of the application load balancer attached to your Fargate service. /// - /// default: 80 /// Corresponds to container port mapping. + /// default: 80 /// [JsiiProperty(name: "containerPort", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] double? ContainerPort @@ -19,8 +19,8 @@ public interface ILoadBalancedFargateServiceProps /// The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments. /// - /// default: 256 /// This default is set in the underlying FargateTaskDefinition construct. + /// default: 256 /// [JsiiProperty(name: "cpu", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string Cpu @@ -30,7 +30,6 @@ string Cpu /// The amount (in MiB) of memory used by the task. /// - /// default: 512 /// This field is required and you must use one of the following values, which determines your range of valid values /// for the cpu parameter: /// @@ -45,6 +44,7 @@ string Cpu /// Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) /// /// This default is set in the underlying FargateTaskDefinition construct. + /// default: 512 /// [JsiiProperty(name: "memoryMiB", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] string MemoryMiB diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs index f6dd438d10..d0938bf238 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServiceProps.cs @@ -8,8 +8,8 @@ public class LoadBalancedFargateServiceProps : ILoadBalancedFargateServiceProps { /// The container port of the application load balancer attached to your Fargate service. /// - /// default: 80 /// Corresponds to container port mapping. + /// default: 80 /// [JsiiProperty(name: "containerPort", typeJson: "{\"primitive\":\"number\"}", isOptional: true, isOverride: true)] public double? ContainerPort @@ -20,8 +20,8 @@ public double? ContainerPort /// The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments. /// - /// default: 256 /// This default is set in the underlying FargateTaskDefinition construct. + /// default: 256 /// [JsiiProperty(name: "cpu", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string Cpu @@ -32,7 +32,6 @@ public string Cpu /// The amount (in MiB) of memory used by the task. /// - /// default: 512 /// This field is required and you must use one of the following values, which determines your range of valid values /// for the cpu parameter: /// @@ -47,6 +46,7 @@ public string Cpu /// Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) /// /// This default is set in the underlying FargateTaskDefinition construct. + /// default: 512 /// [JsiiProperty(name: "memoryMiB", typeJson: "{\"primitive\":\"string\"}", isOptional: true, isOverride: true)] public string MemoryMiB diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs index ab2a528b2e..33d493d337 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/LoadBalancedFargateServicePropsProxy.cs @@ -12,8 +12,8 @@ private LoadBalancedFargateServicePropsProxy(ByRefValue reference): base(referen /// The container port of the application load balancer attached to your Fargate service. /// - /// default: 80 /// Corresponds to container port mapping. + /// default: 80 /// [JsiiProperty(name: "containerPort", typeJson: "{\"primitive\":\"number\"}", isOptional: true)] public double? ContainerPort @@ -23,8 +23,8 @@ public double? ContainerPort /// The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments. /// - /// default: 256 /// This default is set in the underlying FargateTaskDefinition construct. + /// default: 256 /// [JsiiProperty(name: "cpu", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string Cpu @@ -34,7 +34,6 @@ public string Cpu /// The amount (in MiB) of memory used by the task. /// - /// default: 512 /// This field is required and you must use one of the following values, which determines your range of valid values /// for the cpu parameter: /// @@ -49,6 +48,7 @@ public string Cpu /// Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) /// /// This default is set in the underlying FargateTaskDefinition construct. + /// default: 512 /// [JsiiProperty(name: "memoryMiB", typeJson: "{\"primitive\":\"string\"}", isOptional: true)] public string MemoryMiB diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs index e9bcf3863c..5781883cb4 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs +++ b/packages/jsii-pacmak/test/expected.jsii-calc/dotnet/Amazon.JSII.Tests.CalculatorPackageId/Amazon/JSII/Tests/CalculatorNamespace/ReturnsPrivateImplementationOfInterface.cs @@ -3,7 +3,7 @@ namespace Amazon.JSII.Tests.CalculatorNamespace { /// Helps ensure the JSII kernel & runtime cooperate correctly when an un-exported instance of a class is returned with a declared type that is an exported interface, and the instance inherits from an exported class. - /// see: https://github.com/awslabs/jsii/issues/320 + /// https://github.com/awslabs/jsii/issues/320 [JsiiClass(nativeType: typeof(ReturnsPrivateImplementationOfInterface), fullyQualifiedName: "jsii-calc.ReturnsPrivateImplementationOfInterface")] public class ReturnsPrivateImplementationOfInterface : DeputyBase { diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/$Module.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/$Module.java index 268c9bd522..f9ebbbc92d 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/$Module.java +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/$Module.java @@ -32,6 +32,7 @@ protected Class resolveClass(final String fqn) throws ClassNotFoundException case "jsii-calc.CalculatorProps": return software.amazon.jsii.tests.calculator.CalculatorProps.class; case "jsii-calc.ClassThatImplementsTheInternalInterface": return software.amazon.jsii.tests.calculator.ClassThatImplementsTheInternalInterface.class; case "jsii-calc.ClassThatImplementsThePrivateInterface": return software.amazon.jsii.tests.calculator.ClassThatImplementsThePrivateInterface.class; + case "jsii-calc.ClassWithDocs": return software.amazon.jsii.tests.calculator.ClassWithDocs.class; case "jsii-calc.ClassWithMutableObjectLiteralProperty": return software.amazon.jsii.tests.calculator.ClassWithMutableObjectLiteralProperty.class; case "jsii-calc.ClassWithPrivateConstructorAndAutomaticProperties": return software.amazon.jsii.tests.calculator.ClassWithPrivateConstructorAndAutomaticProperties.class; case "jsii-calc.ConstructorPassesThisOut": return software.amazon.jsii.tests.calculator.ConstructorPassesThisOut.class; diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ClassWithDocs.java b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ClassWithDocs.java new file mode 100644 index 0000000000..49ccc00648 --- /dev/null +++ b/packages/jsii-pacmak/test/expected.jsii-calc/java/src/main/java/software/amazon/jsii/tests/calculator/ClassWithDocs.java @@ -0,0 +1,26 @@ +package software.amazon.jsii.tests.calculator; + +/** + * This class has docs. + * + * The docs are great. They're a bunch of tags. + * + * Example: + * + * function anExample() { + * } + * + * @see https://aws.amazon.com/ + * @deprecated Use something else please + */ +@javax.annotation.Generated(value = "jsii-pacmak") +@software.amazon.jsii.Jsii(module = software.amazon.jsii.tests.calculator.$Module.class, fqn = "jsii-calc.ClassWithDocs") +public class ClassWithDocs extends software.amazon.jsii.JsiiObject { + protected ClassWithDocs(final software.amazon.jsii.JsiiObject.InitializationMode mode) { + super(mode); + } + public ClassWithDocs() { + super(software.amazon.jsii.JsiiObject.InitializationMode.Jsii); + software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this); + } +} diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py index dcd44f02f9..516aecddb7 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py +++ b/packages/jsii-pacmak/test/expected.jsii-calc/python/src/jsii_calc/__init__.py @@ -352,6 +352,11 @@ class CalculatorProps(jsii.compat.TypedDict, total=False): initialValue: jsii.Number maximumValue: jsii.Number +class ClassWithDocs(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.ClassWithDocs"): + def __init__(self) -> None: + jsii.create(ClassWithDocs, self, []) + + class ClassWithMutableObjectLiteralProperty(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.ClassWithMutableObjectLiteralProperty"): def __init__(self) -> None: jsii.create(ClassWithMutableObjectLiteralProperty, self, []) @@ -2608,6 +2613,6 @@ def parts(self, value: typing.List[scope.jsii_calc_lib.Value]): return jsii.set(self, "parts", value) -__all__ = ["AbstractClass", "AbstractClassBase", "AbstractClassReturner", "Add", "AllTypes", "AllTypesEnum", "AllowedMethodNames", "AsyncVirtualMethods", "AugmentableClass", "BinaryOperation", "Calculator", "CalculatorProps", "ClassThatImplementsTheInternalInterface", "ClassThatImplementsThePrivateInterface", "ClassWithMutableObjectLiteralProperty", "ClassWithPrivateConstructorAndAutomaticProperties", "ConstructorPassesThisOut", "Constructors", "ConsumersOfThisCrazyTypeSystem", "DefaultedConstructorArgument", "DerivedClassHasNoProperties", "DerivedStruct", "DoNotOverridePrivates", "DoNotRecognizeAnyAsOptional", "DocumentedClass", "DontComplainAboutVariadicAfterOptional", "DoubleTrouble", "EraseUndefinedHashValues", "EraseUndefinedHashValuesOptions", "ExportedBaseClass", "ExtendsInternalInterface", "GiveMeStructs", "Greetee", "GreetingAugmenter", "IAnotherPublicInterface", "IExtendsPrivateInterface", "IFriendlier", "IFriendlyRandomGenerator", "IInterfaceImplementedByAbstractClass", "IInterfaceThatShouldNotBeADataType", "IInterfaceWithInternal", "IInterfaceWithMethods", "IInterfaceWithOptionalMethodArguments", "IInterfaceWithProperties", "IInterfaceWithPropertiesExtension", "IJSII417Derived", "IJSII417PublicBaseOfBase", "IMutableObjectLiteral", "INonInternalInterface", "IPrivatelyImplemented", "IPublicInterface", "IPublicInterface2", "IRandomNumberGenerator", "IReturnsNumber", "ImplementInternalInterface", "ImplementsInterfaceWithInternal", "ImplementsInterfaceWithInternalSubclass", "ImplementsPrivateInterface", "ImplictBaseOfBase", "InbetweenClass", "InterfaceInNamespaceIncludesClasses", "InterfaceInNamespaceOnlyInterface", "JSII417Derived", "JSII417PublicBaseOfBase", "JSObjectLiteralForInterface", "JSObjectLiteralToNative", "JSObjectLiteralToNativeClass", "JavaReservedWords", "JsiiAgent", "LoadBalancedFargateServiceProps", "Multiply", "Negate", "NodeStandardLibrary", "NullShouldBeTreatedAsUndefined", "NullShouldBeTreatedAsUndefinedData", "NumberGenerator", "ObjectRefsInCollections", "Old", "OptionalConstructorArgument", "OptionalStruct", "OptionalStructConsumer", "OverrideReturnsObject", "PartiallyInitializedThisConsumer", "Polymorphism", "Power", "PublicClass", "PythonReservedWords", "ReferenceEnumFromScopedPackage", "ReturnsPrivateImplementationOfInterface", "RuntimeTypeChecking", "SingleInstanceTwoTypes", "Statics", "StringEnum", "StripInternal", "Sum", "SyncVirtualMethods", "Thrower", "UnaryOperation", "UnionProperties", "UseBundledDependency", "UseCalcBase", "UsesInterfaceWithProperties", "VariadicMethod", "VirtualMethodPlayground", "__jsii_assembly__", "composition"] +__all__ = ["AbstractClass", "AbstractClassBase", "AbstractClassReturner", "Add", "AllTypes", "AllTypesEnum", "AllowedMethodNames", "AsyncVirtualMethods", "AugmentableClass", "BinaryOperation", "Calculator", "CalculatorProps", "ClassThatImplementsTheInternalInterface", "ClassThatImplementsThePrivateInterface", "ClassWithDocs", "ClassWithMutableObjectLiteralProperty", "ClassWithPrivateConstructorAndAutomaticProperties", "ConstructorPassesThisOut", "Constructors", "ConsumersOfThisCrazyTypeSystem", "DefaultedConstructorArgument", "DerivedClassHasNoProperties", "DerivedStruct", "DoNotOverridePrivates", "DoNotRecognizeAnyAsOptional", "DocumentedClass", "DontComplainAboutVariadicAfterOptional", "DoubleTrouble", "EraseUndefinedHashValues", "EraseUndefinedHashValuesOptions", "ExportedBaseClass", "ExtendsInternalInterface", "GiveMeStructs", "Greetee", "GreetingAugmenter", "IAnotherPublicInterface", "IExtendsPrivateInterface", "IFriendlier", "IFriendlyRandomGenerator", "IInterfaceImplementedByAbstractClass", "IInterfaceThatShouldNotBeADataType", "IInterfaceWithInternal", "IInterfaceWithMethods", "IInterfaceWithOptionalMethodArguments", "IInterfaceWithProperties", "IInterfaceWithPropertiesExtension", "IJSII417Derived", "IJSII417PublicBaseOfBase", "IMutableObjectLiteral", "INonInternalInterface", "IPrivatelyImplemented", "IPublicInterface", "IPublicInterface2", "IRandomNumberGenerator", "IReturnsNumber", "ImplementInternalInterface", "ImplementsInterfaceWithInternal", "ImplementsInterfaceWithInternalSubclass", "ImplementsPrivateInterface", "ImplictBaseOfBase", "InbetweenClass", "InterfaceInNamespaceIncludesClasses", "InterfaceInNamespaceOnlyInterface", "JSII417Derived", "JSII417PublicBaseOfBase", "JSObjectLiteralForInterface", "JSObjectLiteralToNative", "JSObjectLiteralToNativeClass", "JavaReservedWords", "JsiiAgent", "LoadBalancedFargateServiceProps", "Multiply", "Negate", "NodeStandardLibrary", "NullShouldBeTreatedAsUndefined", "NullShouldBeTreatedAsUndefinedData", "NumberGenerator", "ObjectRefsInCollections", "Old", "OptionalConstructorArgument", "OptionalStruct", "OptionalStructConsumer", "OverrideReturnsObject", "PartiallyInitializedThisConsumer", "Polymorphism", "Power", "PublicClass", "PythonReservedWords", "ReferenceEnumFromScopedPackage", "ReturnsPrivateImplementationOfInterface", "RuntimeTypeChecking", "SingleInstanceTwoTypes", "Statics", "StringEnum", "StripInternal", "Sum", "SyncVirtualMethods", "Thrower", "UnaryOperation", "UnionProperties", "UseBundledDependency", "UseCalcBase", "UsesInterfaceWithProperties", "VariadicMethod", "VirtualMethodPlayground", "__jsii_assembly__", "composition"] publication.publish() diff --git a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst index 83f8ba616b..f169148b62 100644 --- a/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst +++ b/packages/jsii-pacmak/test/expected.jsii-calc/sphinx/jsii-calc.rst @@ -1179,6 +1179,43 @@ ClassThatImplementsThePrivateInterface :type: string +ClassWithDocs +^^^^^^^^^^^^^ + +.. py:class:: ClassWithDocs() + + **Language-specific names:** + + .. tabs:: + + .. code-tab:: c# + + using Amazon.JSII.Tests.CalculatorNamespace; + + .. code-tab:: java + + import software.amazon.jsii.tests.calculator.ClassWithDocs; + + .. code-tab:: javascript + + const { ClassWithDocs } = require('jsii-calc'); + + .. code-tab:: typescript + + import { ClassWithDocs } from 'jsii-calc'; + + + + This class has docs. + + + + The docs are great. They're a bunch of tags. + + https://aws.amazon.com/ + + + ClassWithMutableObjectLiteralProperty ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/packages/jsii-reflect/test/classes.expected.txt b/packages/jsii-reflect/test/classes.expected.txt index cb4fb67e59..30732595bf 100644 --- a/packages/jsii-reflect/test/classes.expected.txt +++ b/packages/jsii-reflect/test/classes.expected.txt @@ -12,6 +12,7 @@ BinaryOperation Calculator ClassThatImplementsTheInternalInterface ClassThatImplementsThePrivateInterface +ClassWithDocs ClassWithMutableObjectLiteralProperty ClassWithPrivateConstructorAndAutomaticProperties CompositeOperation diff --git a/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt index 8cedbe8046..6ddbb65257 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt +++ b/packages/jsii-reflect/test/jsii-tree.test.all.expected.txt @@ -245,6 +245,9 @@ assemblies │ │ │ └── type: string │ │ └─┬ e property │ │ └── type: string + │ ├─┬ class ClassWithDocs + │ │ └─┬ members + │ │ └── () initializer │ ├─┬ class ClassWithMutableObjectLiteralProperty │ │ └─┬ members │ │ ├── () initializer diff --git a/packages/jsii-reflect/test/jsii-tree.test.inheritance.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.inheritance.expected.txt index 44fef32619..fe802e2cfa 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.inheritance.expected.txt +++ b/packages/jsii-reflect/test/jsii-tree.test.inheritance.expected.txt @@ -21,6 +21,7 @@ assemblies │ │ └── interfaces: INonInternalInterface │ ├─┬ class ClassThatImplementsThePrivateInterface │ │ └── interfaces: INonInternalInterface + │ ├── class ClassWithDocs │ ├── class ClassWithMutableObjectLiteralProperty │ ├─┬ class ClassWithPrivateConstructorAndAutomaticProperties │ │ └── interfaces: IInterfaceWithProperties diff --git a/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt index 38662401b8..4bfd49d3bb 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt +++ b/packages/jsii-reflect/test/jsii-tree.test.members.expected.txt @@ -102,6 +102,9 @@ assemblies │ │ ├── b property │ │ ├── c property │ │ └── e property + │ ├─┬ class ClassWithDocs + │ │ └─┬ members + │ │ └── () initializer │ ├─┬ class ClassWithMutableObjectLiteralProperty │ │ └─┬ members │ │ ├── () initializer diff --git a/packages/jsii-reflect/test/jsii-tree.test.types.expected.txt b/packages/jsii-reflect/test/jsii-tree.test.types.expected.txt index 9064401cf4..2b325e63f3 100644 --- a/packages/jsii-reflect/test/jsii-tree.test.types.expected.txt +++ b/packages/jsii-reflect/test/jsii-tree.test.types.expected.txt @@ -13,6 +13,7 @@ assemblies │ ├── class Calculator │ ├── class ClassThatImplementsTheInternalInterface │ ├── class ClassThatImplementsThePrivateInterface + │ ├── class ClassWithDocs │ ├── class ClassWithMutableObjectLiteralProperty │ ├── class ClassWithPrivateConstructorAndAutomaticProperties │ ├── class ConstructorPassesThisOut