spadgos / sublime-jsdocs

Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C & C++

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automatic return tag

alphanull opened this issue · comments

Would be more convenient that when documenting a method, DocBlockr only adds @return if there is actually a return present in the following code block - or even better, if there is actually something following this return.

I.e. if I only have return;-> do not add this tag, if I have return something; -> add it.

If you validate your code&docblocks against PHP_CodeSniffer, it will immediately show an error if @return is missing (ERROR | Missing @return tag in function comment).

In cases you do not have a return value, you can use @return void as written in the PHPdoc docs.

@alphanull by design, docblockr doesn't try to do any intelligent parsing of the function body. It simply uses regex parsing the arguments list. Doing more than that adds exponential complication to parse and interpret all the different supported languages.

The solution is: just delete the line with @return when you don't actually want it.