This extension simplifies addition of NatSpec compliant @author, @title, @notice, @dev, @param and @return tags in Solidity files.
The solidity-comments VS Code extension can be installed 1. from VS Code Marketplace or 1. from a VSIX file.
- On the VS Code Marketplace the extension can be found with its name vscode-solidity-comments.
- Click Install.
- The VSIX file can be downloaded from the release page on GitHub.
- Go to
Extensionstab in VS Code and click...at the top. - Select
Install from VSIXand point the file selector dialog to the downloaded VSIX file.
- Go to
-
In a Solidity file, move the cursor to a line with a contract, interface, library, function or modifier keywords.
-
Invoke the
Add Solidity Commentsextension- Open the command palette wit
F1orctrl+shift+pon Windows and findAdd Solidity Comments. Hit enter. - Alternatively, you can use the keybindings
ctrl+alt+don Windows andshift+cmd+don Mac.
- Open the command palette wit
-
The extension will parse the signature on the line of the cursor and add NatSpec doc comments above the line.
For contract, interface and library keywords the extension adds a header as follows:
/** * @author . * @title . * @dev . * @notice . */For function and modifier keywords the extension adds comments as follows:
/** * @notice . * @dev . * @param _address . * @return bool . */
The extension does not support any other type of NatSpec tags. It only uses @title, @author, @notice, @dev, @param and @return tags.
Please use the extension at your own risk as is knowing that there is no active support for it.
If you have a feature request or bug report you can open an issue from the issues page on GitHub.
Please note that there is no promise that these issues will be prioritized among other projects.