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

fix: variadic arguments are incorrectly displayed as base type in docs #1556

Merged
merged 46 commits into from
Sep 10, 2024

Conversation

sumupitchayan
Copy link
Contributor

@sumupitchayan sumupitchayan commented Sep 3, 2024

Fixes #648

Fixes issue where variadic arguments are incorrectly displayed as the base type in documentation.

Example from the original issue:

public add(...scopes: IDependable[])

is shown as:

public void add(IDependable scopes)

…assemblies class

Signed-off-by: Sumu <sumughan@amazon.com>
…rkdown renderer

Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Copy link
Contributor

@iliapolo iliapolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple high level comments:

  • We talked about fixing the assembly.system.classes to use assembly.classes in the various lookup functions. Are you planning on doing this in a separate PR?
  • PR title should indicate what the specific problem was. Remember that it is the first thing customers see in the change log, so it should be as specific as possible. How exactly were variadics wrong in the docs?

src/docgen/render/markdown-render.ts Outdated Show resolved Hide resolved
test/docgen/assemblies.ts Outdated Show resolved Hide resolved
test/docgen/view/initializer.test.ts Outdated Show resolved Hide resolved
test/docgen/view/initializer.test.ts Outdated Show resolved Hide resolved
test/docgen/view/initializer.test.ts Outdated Show resolved Hide resolved
test/docgen/view/initializer.test.ts Outdated Show resolved Hide resolved
test/docgen/view/initializer.test.ts Outdated Show resolved Hide resolved
test/docgen/view/initializer.test.ts Outdated Show resolved Hide resolved
src/docgen/render/markdown-render.ts Outdated Show resolved Hide resolved
sumupitchayan and others added 2 commits September 4, 2024 08:45
Co-authored-by: Eli Polonsky <epolon@amazon.com>
Co-authored-by: Eli Polonsky <epolon@amazon.com>
@sumupitchayan
Copy link
Contributor Author

  • We talked about fixing the assembly.system.classes to use assembly.classes in the various lookup functions. Are you planning on doing this in a separate PR?

Yea, I think it'd be better to separate that from this fix. This PR would be cluttered with the snapshot updates from both fixes

Signed-off-by: Sumu <sumughan@amazon.com>
@sumupitchayan sumupitchayan changed the title fix: variadic arguments in docs fix: variadic arguments are displayed as base type in docs Sep 4, 2024
@sumupitchayan sumupitchayan changed the title fix: variadic arguments are displayed as base type in docs fix: variadic arguments are incorrectly displayed as base type in docs Sep 4, 2024
sumupitchayan and others added 13 commits September 4, 2024 12:24
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
…(for now)

Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
…language's transpiler

Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
src/docgen/view/parameter.ts Outdated Show resolved Hide resolved
src/docgen/transpile/python.ts Outdated Show resolved Hide resolved
src/docgen/transpile/typescript.ts Outdated Show resolved Hide resolved
test/docgen/assemblies.ts Outdated Show resolved Hide resolved
test/docgen/view/parameter.test.ts Outdated Show resolved Hide resolved
sumupitchayan and others added 3 commits September 5, 2024 15:26
…languages

Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Co-authored-by: Eli Polonsky <epolon@amazon.com>
sumupitchayan and others added 2 commits September 6, 2024 14:47
test/docgen/view/parameter.test.ts Outdated Show resolved Hide resolved
test/docgen/view/parameter.test.ts Outdated Show resolved Hide resolved
test/docgen/view/parameter.test.ts Outdated Show resolved Hide resolved
src/docgen/transpile/csharp.ts Outdated Show resolved Hide resolved
src/docgen/transpile/typescript.ts Outdated Show resolved Hide resolved
src/docgen/view/parameter.ts Outdated Show resolved Hide resolved
let typeschema = this.transpiledParam.typeReference.toJson();
if (this.parameter.spec.variadic) {
typeschema = {
formattingPattern: this.transpile.variadicOf(this.transpiledParam.typeReference.toString()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is tricky to understand. Please explain with some examples.

src/docgen/transpile/csharp.ts Outdated Show resolved Hide resolved

---

##### \`deps\`<sup>Required</sup> <a name="deps" id="DependencyGroup.Initializer.parameter.deps"></a>

- *Type:* <a href="/packages/constructs/v/99.99.99/api/IDependable?lang=python">IDependable</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, this doesn't look right...somehow we are dropping the link. This should be:

...<a href="/packages/constructs/v/99.99.99/api/IDependable?lang=python">IDependable</a>

sumupitchayan and others added 14 commits September 9, 2024 09:33
Co-authored-by: Eli Polonsky <epolon@amazon.com>
Co-authored-by: Eli Polonsky <epolon@amazon.com>
Co-authored-by: Eli Polonsky <epolon@amazon.com>
Co-authored-by: Eli Polonsky <epolon@amazon.com>
Co-authored-by: Eli Polonsky <epolon@amazon.com>
Signed-off-by: github-actions <github-actions@github.com>
Signed-off-by: github-actions <github-actions@github.com>
Co-authored-by: Eli Polonsky <epolon@amazon.com>
…t function

Signed-off-by: Sumu <sumughan@amazon.com>
…parameter.ts

Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
Signed-off-by: Sumu <sumughan@amazon.com>
@iliapolo
Copy link
Contributor

@sumupitchayan Any reason this PR is still in draft?

@sumupitchayan sumupitchayan marked this pull request as ready for review September 10, 2024 13:03
@sumupitchayan
Copy link
Contributor Author

@sumupitchayan Any reason this PR is still in draft?

@iliapolo nope, just marked as ready

@mergify mergify bot merged commit f302233 into main Sep 10, 2024
18 checks passed
@mergify mergify bot deleted the sumughan/fix-variadic-arg-docs branch September 10, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Variadic arguments are not treated as such
2 participants