sublime-jsdocs icon indicating copy to clipboard operation
sublime-jsdocs copied to clipboard

[REQUEST] Auto @author value

Open Larandar opened this issue 12 years ago • 11 comments

Since I hope you don't have twenty-four personality it will be very useful to have an option for auto-completing @author tag with your name.

Larandar avatar Dec 04 '12 14:12 Larandar

You can use jsdocs_extra_tags to do that.

jsdocs_extra_tags (Array.String) An array of strings, each representing extra boilerplate comments to add to functions. These can also include arbitrary text (not just tags).

// jsdocs_extra_tags = ['This is a cool function', '@author nickf', '@version ${1:version}']
/**<<enter>>
function foo (x) {}

/**
 * [foo description]
 * This is a cool function
 * @author nickf
 * @version [version]
 * @param  {[type]} x [description]
 * @return {[type]}
 */

spadgos avatar Dec 05 '12 13:12 spadgos

I already know about jsdocs_extra_tags and this is not what I whant. jsdocs_extra_tags apply each time I open a DocBlock and my coding convention are : @author and @version when creating a class, @author IF adding method in SOMEONE ELSE class.

Larandar avatar Dec 05 '12 13:12 Larandar

I see. So, check the docblock at the top of the file to see if it contains an @author tag which doesn't match yours and add the tag then? If so, then I think that's way out of scope for this plugin.

spadgos avatar Dec 05 '12 13:12 spadgos

No no, just preference that permit to define the default "author" and default "email":

If I define "js_author_name" : "Adrien \"Larandar\" Dudouit-Exposito" and "js_author_email" : "[email protected]"

Then @author will expend to @author Adrien "Larandar" Dudouit-Exposito <[email protected]>

Unlike default @author [author] <[email]>

( Sorry , my English is maybe worst that my explication )

Larandar avatar Dec 05 '12 13:12 Larandar

Is possible add the additional tags after @return?

brunowego avatar Jan 20 '13 18:01 brunowego

@brunobatista you can now with the jsdocs_extra_tags_go_after option.

spadgos avatar May 11 '13 15:05 spadgos

jsdocs_extra_tags

this thing don't work with me ??? some one help

LeCanardNoir avatar Sep 10 '13 15:09 LeCanardNoir

@spadgos when I use jsdocs_extra_tags to auto-populate the author like this: // jsdocs_extra_tags = ['This is a cool function', '@author nickf <[email protected]>', '@version ${1:version}'] the regex removes the entry altogether because there is currently no apparent way to escape @. Or am I mistaken?

wpsmith avatar May 06 '14 16:05 wpsmith

@Larandar I understand your needs,How do you solve?

ljyf5593 avatar May 15 '14 02:05 ljyf5593

Hi @spadgos - firstly, nice work on the plugin - it's super useful! Now I totally agree with what @Larandar is asking for. I don't necessarily want the @author tag to be added to every single doc block, but if I type @author and press tab for auto-completion I'd love it if it could automatically insert a default value defined in user settings. It would be incredibly useful, and relevant since everyone would be using their own terminal to develop.

robbieaverill avatar Jul 06 '15 01:07 robbieaverill

@spadgos bump - any plans to implement this?

robbieaverill avatar May 19 '16 22:05 robbieaverill