thesis / vim-solidity

Syntax highlighting for Solidity in Vim
MIT License
50 stars 7 forks source link

Highlight NatSpec syntax #4

Closed mhluongo closed 3 years ago

wschwab commented 4 years ago

Want to provide a reference for this issue. Spec is taken from the Solidity docs: https://solidity.readthedocs.io/en/latest/natspec-format.html

Note The Solidity compiler only interprets tags if they are external or public. You are welcome to use similar comments for your internal and private functions, but those will not be parsed.

Tags

All tags are optional. The following table explains the purpose of each NatSpec tag and where it may be used. As a special case, if no tags are used then the Solidity compiler will interpret a /// or /** comment in the same way as if it were tagged with @notice.

Tag Context

@title A title that should describe the contract/interface contract, interface @author The name of the author contract, interface @notice Explain to an end user what this does contract, interface, function, public state variable, event @dev Explain to a developer any extra details contract, interface, function, state variable, event @param Documents a parameter just like in doxygen (must be followed by parameter name) function, event @return Documents the return variables of a contract's function function, public state variable

If your function returns multiple values, like (int quotient, int remainder) then use multiple @return statements in the same format as the @param statements.

hbarcelos commented 3 years ago

Looks like tags in /** */ style comments are not being highlighted:

image

I just re-installed this plugin and opened a .sol file, so I'm sure I have the latest version.