Skip to content

feat(doc): new section "Constants" for constants and immutables  #4611

Open
@PaulRBerg

Description

@PaulRBerg

Component

Forge

Describe the feature you would like

Given the following Solidity contract:

// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.8.19;

contract Counter {
    uint256 public constant FOO = 1;
    uint256 public immutable BAR;

    constructor() {
        BAR = 2;
    }
}

forge doc will produce the following Markdown docs:

# Counter

## State Variables
### FOO

```solidity
uint256 public constant FOO = 1;
```


### BAR

```solidity
uint256 public immutable BAR;
```

That is, Forge will nest the FOO constant and the BAR immutable under a section called "State Variables".

The name of this section is misleading. It should say "Constants" instead.

Additional context

No response

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