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

NatSpec @notice, @param and @dev for enums and structs #432

Open
heueristik opened this issue Feb 8, 2023 · 5 comments
Open

NatSpec @notice, @param and @dev for enums and structs #432

heueristik opened this issue Feb 8, 2023 · 5 comments

Comments

@heueristik
Copy link

It would be great if NatSpec @notice, @param and @dev comments on structs and enums would be available in the documentation.

For example, having

/// @notice Text.
/// @param a Text 1.
/// @param b Text 2.
struct ProposalParameters {
    bool a;
    uint256 b;
}

and documenting it with

{{natspec.notice}}

{{#if natspec.params}}
  | Member | Type | Description |
  |:------ | ---- | ----------- |
  {{#each params}}
    | {{name}} | {{type}} | {{natspec}} |
  {{/each}}
{{/if}}

I am aware of #413, but still unsure if this is possible by now or not because of insufficiencies of the solidity compiler.

@frangio
Copy link
Contributor

frangio commented Feb 9, 2023

This is a problem with the Solidity compiler. I might be able to work around it with some effort but it really needs to be fixed upstream. See ethereum/solidity#12295.

@Whytecrowe
Copy link

Would really love to have this feature!
Any updates on this?
Data for struct definitions is available and can be formatted into an md file. Strange there's still no solution for this.

@frangio
Copy link
Contributor

frangio commented Jul 28, 2023

This should work out of the box already for structs and enums as long as Solidity >=0.8.20 is used.

@param is still not supported. Solidity continues to be the limitation for that.

@BeamNawapat
Copy link

I believe this feature should be implemented.

@0xneves
Copy link

0xneves commented Dec 15, 2023

I believe this feature should be implemented.

Came looking for this, would be a perfect addition.

0xneves added a commit to 0xneves/swaplace-contracts that referenced this issue Dec 15, 2023
- Fixed NatSpec problems
- Manually edited some solidity-docgen output

If the following issues get resolved, we'll be able to correctly run solidity-docgen.
- [Uderscores are incorrectly placed](OpenZeppelin/solidity-docgen#432)
- [Structs are not documented](OpenZeppelin/solidity-docgen#432)
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

No branches or pull requests

5 participants