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