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

Infer the name of a destructured parameter #1704

Merged
merged 2 commits into from Sep 23, 2021

Conversation

Gudahtt
Copy link
Contributor

@Gudahtt Gudahtt commented Sep 20, 2021

The name of a destructured parameter can now be inferred from a JSDoc comment. The name is only inferred if the number of top-level @param tags in the JSDoc comment exactly matches the number of parameters.

Closes #1703

The name of a destructured parameter can now be inferred from a JSDoc
comment. The name is only inferred if the number of top-level `@param`
tags in the JSDoc comment exactly matches the number of parameters.

Closes TypeStrong#1703
Three additional test cases have been added to the `function` tests in
the `converter` test directory. There is a test for when there are the
correct number of `@param` directives, and there are tests for the
cases where there is one too many or one too few `@param` directives.
@Gudahtt Gudahtt marked this pull request as ready for review September 21, 2021 21:22
@Gudahtt
Copy link
Contributor Author

Gudahtt commented Sep 21, 2021

Let me know if I can improve the tests in any way. I decided to extend the set of function tests because this seemed like it fit with the others, but I can add a separate directory for it if that would be preferred.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Sep 23, 2021

Looks good! I would have put the tests exactly where you did, or potentially in converter2/behavior, depending on my mood at the time.

@Gerrit0 Gerrit0 merged commit 01d9ac1 into TypeStrong:master Sep 23, 2021
Gudahtt added a commit to MetaMask/eth-sig-util that referenced this pull request May 13, 2022
A fork of `typedoc` was being used because it included an enhancement
to how destructured parameters are interpreted [1]. This enhancement
has since been merged and published as v0.22.5, so we don't need to
use the fork anymore.

[1]: TypeStrong/typedoc#1704
[2]: https://github.com/TypeStrong/typedoc/releases/tag/v0.22.5
Gudahtt added a commit to MetaMask/eth-sig-util that referenced this pull request May 13, 2022
A fork of `typedoc` was being used because it included an enhancement
to how destructured parameters are interpreted [1]. This enhancement
has since been merged and published as v0.22.5 [2], so we don't need to
use the fork anymore.

[1]: TypeStrong/typedoc#1704
[2]: https://github.com/TypeStrong/typedoc/releases/tag/v0.22.5
Gudahtt added a commit to MetaMask/eth-sig-util that referenced this pull request May 13, 2022
A fork of `typedoc` was being used because it included an enhancement
to how destructured parameters are interpreted [1]. This enhancement
has since been merged and published as v0.22.5 [2], so we don't need to
use the fork anymore.

[1]: TypeStrong/typedoc#1704
[2]: https://github.com/TypeStrong/typedoc/releases/tag/v0.22.5
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.

Derive parameter name of desctructured parameter from JSDoc comment
2 participants