Sublime Forum

DocBlockr for Javascript, PHP and CoffeeScript

#3

Awesome! Thank you.

0 Likes

#4

Awesome plugin! Really missed this, most of the big IDEā€™s got this already and now its in sublime to!

Great job :smile:!

0 Likes

#5

[quote=ā€œxaviā€]Great job!!

Typing @ inside a docblock show all my snippets but no JSDoc supported ones. Iā€™m using Sublime Text 2 build 2131 on Ubuntu Linux[/quote]

Hey Xavi,

Iā€™m running on Ubuntu as well, but canā€™t recreate your error. I do have an issue tracker on github if you (or anyone) has any problems. github.com/spadgos/sublime-jsdocs/issues

0 Likes

#6

Hi all,

Iā€™ve just released an update to the JSDocs package:

From the changelog

[quote]v1.3.0, 5 November 2011
Improvements to handling of single-line comments
Functions beginning with is or has are assumed to return Booleans
Consolidated settings files into Base File.sublime-settings.** If you had configured your settings in jsdocs.sublime-settings, please move them to the Base File settings.**
Setting jsdocs_extend_double_slashes controls whether single-line comments are extended.
Pressing tab in a docblock will tab to match the description block of the previous tag. Use jsdocs_deep_indent to toggle this behaviour.[/quote]

Hereā€™s a demonstration of that last bullet point:

[code]/**

  • @param {String} foo Lorem ipsum dolor sit amet
  • |<>
    */

ā€“ becomes

/**

  • @param {String} foo Lorem ipsum dolor sit amet
  •                 |
    

*/[/code]

Please do give it a try and let me know if you find any problems or have any feature requests by submitting an issue on the Github tracker: github.com/spadgos/sublime-jsdocs/issues

Cheers!

0 Likes

#7

Hey guys,

Donā€™t mean to be spamming, but Iā€™ve released version 2.0.0 of JSDocs which now officially supports PHP. Iā€™ve edited the post at the start of this thread, but the readme on the github repo has the most info.

Give it a try and let me know how it is!

0 Likes

#8

Thank you spadgos,

It works well, itā€™s a real pleasure to not type thousands of ā€˜*ā€™ :smiley:

0 Likes

#9

Iā€™ve just released an update, now at version 2.1.0. From the changelog:

  • Added a command to join lines inside a docblock which is smart to leading asterisks Press Ctrl+J to join lines
  • Variable types are guessed from their name. is and has are assumed to be Booleans, and callback, cb, done, fn and next are assumed to be Functions.
  • You can now define your own patterns for mapping a variable name to a type. See the README for documentation about the format
  • Autocomplete works better now. @ will also insert the ā€œ@ā€ character, allowing you to add any tag you like, even if it isnā€™t in the autocomplete list.
  • Added the full set of PHPDoc tags.
0 Likes

#10

I thought Iā€™d give this thread a bump since Iā€™ve just added support for CoffeeScript.

0 Likes

#11

Great Plugin!

One suggestion:
If I enter a ā€œone Line commentā€ like // and I hit enter it will continue to add // to the next line. Most of the time (or always) I have to get rid of those, so they are not too helpful :wink:

Usually if I need multiline comments I use /** oder /*. They work fine!

Greets,
Simon

0 Likes

#12

Hey Fannon,

There is a configuration option for disabling that feature. Just set ā€œjsdocs_extend_double_slashā€: false in your Base File.sublime-settings (or Preferences.sublime-settings if youā€™re on the dev branch). The other option is to press Shift+Enter and it wonā€™t extend the comment.

0 Likes

#13

Thanks! Exactly what I wanted :wink:

0 Likes

#14

Was looking for something exactly like this. It actually does more than I even thought I wanted, too. Thanks so much!

0 Likes

#15

As a feature request - more control over the whitespace, please!

The deep alignment is pretty close, but thereā€™s a few differences from what my companyā€™s code-sniffing will accept, namely that we donā€™t align the first column with other tags. So, when thereā€™s @param and @return, this pluginā€™s deep alignment puts two spaces after the @param, but the code sniffer wants just one.

Also, we do a newline after the descriptions, but no newline before the @return tag.

Really, this is awesome, though - not a big deal to fix those myself, and much better than typing out the whole thing!

0 Likes

#16

hey mpedrummer,

I believe that at least some of your requests are already implemented ā€“ you just need to set a config variable. The docs are in the readme and all the options are documented at the bottom of that page.

I think youā€™d probably want ā€œjsdocs_align_tagsā€: false here.

For the spacing between sections, Iā€™ve put that into an issue so I wonā€™t forget about it. :smile:

0 Likes

#17

Thanks spagdos!

Unfortunately, all three settings arenā€™t quite what we need - which may indicate we should change the code-sniffing standard! Deep alignment is closest - we do align columns, but only within the same tag, not across all tags like deep does. Actually, shallow aligns the first column across all tags, too. ā€œNoā€ means I have to manually align all the columns, which really isnā€™t the end of the world.

Iā€™m going to leave it on ā€œnoā€ for a few days, see what happens there.

Thanks
MPEDrummer

0 Likes

#18

Anyone ventured into adapting this for C++ yet?

0 Likes

#19

Is there some adapting needed for C++? I seem to be happy with how it works with C++ here. :smile:

EDIT: But itā€™s probably because I havenā€™t seen how it detects parameters and stuff in .js, for example. Until now. :smile:

0 Likes

#20

This is a beautifully done! Thanks, spadgos.

Is it possible to customize what string to begin tab-completion of the docblock with? I would love to be able to use doc or // instead of /**.

0 Likes

#21

Thereā€™s been some improvements over the last few months. Supported languages now include: Javascript, PHP, ActionScript, CoffeeScript, Java, Objective C, C and C++. For full changes, check out the changelog: github.com/spadgos/sublime-jsdo ā€¦ HISTORY.md

0 Likes

#22

What should I do when docblockr fails to do anything after installing it?
I have had it installed in ST2 on my Linux Mint box. I also have a VM running on the same Linux box and running Windows 7 there. I installed ST3 there and then the plugin for docblockr. I canā€™t get the plugin to work in either place. I could have sworn it used to work on the Linux ST2 but that was months ago that I tried.
I should add this is all using Javascript files.

I donā€™t know where to get help with this other than here. I find no posted articles on this topic.

0 Likes