I’ve put together a plugin that helps you write docblock style comments.
/**
* These things.
*/
Source and extended README is on GitHub.
Features:
-
Comments are automatically closed, extended and indented.
-
parses the line following the comment to automatically prefill some documentation for you. eg: fills in the @param and @return tags, with tab to jump between sections for quick editing. Makes intelligent guesses about return types of functions, and uses type-hinting and default values (in PHP) to determine parameter data tyeps.
-
Double slash comments (// like this) are extended when enter is pressed.
-
Variable declarations can be documented, with inferred type information whenever possible.
-
Typing an ‘@’ symbol inside a docblock (but only at the start of a line) will bring up a list of all valid jsdoc tags.
-
Join lines command (Ctrl/Cmd+J) works nicely in DocBlocks
Version 1 was primarily designed for Javascript (hence the repo name “jsdocs”)
Version 2 now has proper support for PHP and CoffeeScript, and is designed to be able to be extended easily.
Installation is via cloning the repo into your Packages folder, or by using the Package Control plugin (search for “DocBlockr”)
I’d be very happy to hear feedback, feature requests and bug reports.
Repo: github.com/spadgos/sublime-jsdocs
Issues: github.com/spadgos/sublime-jsdocs/issues
Cheers.