spadgos / sublime-jsdocs

Simplifies writing DocBlock comments in Javascript, PHP, CoffeeScript, Actionscript, C & C++
MIT License
3.11k stars 279 forks source link

Name- and type-substitution #315

Open twjacobsen opened 9 years ago

twjacobsen commented 9 years ago

Would it be possible to add substitution for name and type (function, var, ...), like date and datetime?

Example:

/**
 * @ngdoc       {{type}} --> function
 * @name        {{name}} --> toggleRowVisibility
 * ...
 */
function toggleRowVisibility(event) { ... }
spadgos commented 9 years ago

What system requires this style of documentation? I'll assume it's Angular from the @ngdoc tag. That seems incredibly repetitive and error-prone to me.

twjacobsen commented 9 years ago

Yes, it's Angular. What do you mean by repetitive and error prone? The way Angular is documented, or the suggestion? I can't do much about the way Angular projects are documented, and I think it works great, used with dgeni.. On Oct 15, 2014 6:14 PM, "Nick Fisher" notifications@github.com wrote:

What system requires this style of documentation? I'll assume it's Angular from the @ngdoc tag. That seems incredibly repetitive and error-prone to me.

— Reply to this email directly or view it on GitHub https://github.com/spadgos/sublime-jsdocs/issues/315#issuecomment-59231960 .

spadgos commented 9 years ago

Yeah, I know there's no benefit to discussing the rules of a different system here, but I just meant that (if I understand correctly) this is the correct way to document a function:

/**
 * @ngdoc function
 * @name foo
 */
function foo() {}

...and what value does that comment bring to anyone? Error-prone in that if you rename the function you have to do it twice.