Skip to content

forge(doc): @inheritdoc does not pickup description #7331

Open
@PierrickGT

Description

@PierrickGT

Component

Forge

Describe the feature you would like

@inheritdoc should pickup the parameters description even if the parameters name differ.

Additional context

I have the following Natspec doc in my interface:

    /**
     * @notice Mints `amount` token to `recipient`.
     * @param  recipient The address of the account receiving minted token.
     * @param  amount    The amount of token to mint.
     */
    function mint(address recipient, uint256 amount) external;

In my contract, I inherit from the Natspec doc the following way:

    /// @inheritdoc IZeroToken
    function mint(address recipient_, uint256 amount_) external onlyStandardGovernor {
        _mint(recipient_, amount_);
    }

As you can see, the parameters are suffixed by _ and in consequence, forge doc does not pickup the parameters description:
Screenshot 2024-03-06 at 5 06 27 PM

I think the try_match_inheritdoc function can be improved to match parameters that are prefixed or suffixed by _:

if source.ident() == children.source.ident() {

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions