+3

Doc block auto complete

Garrett Johnson 7 years ago • updated by Dave Akers 6 years ago 5
When I type "/**" it would be great if it automatically finished the docblock for me.
Can't this be done in a snippet?
I don't see how a snippet could do it nicely. Every carriage return should start with [space][astrix][space][cursor]

It'd be awesome to have this feature, I miss it from Komodo IDE.
This snippet does not work for you?
<snippet>
    <content><![CDATA[/**
 * ${0:$TM_SELECTED_TEXT}
 **/]]></content>
    <tabTrigger>/**</tabTrigger>
    <scope>source.js</scope>
    <description>doc block</description>
</snippet>
Now I see what you mean. You need a plugin that checks if current region is a multi-line comment, and on every new line it should place the asterisk and indent correctly.

I would like this also. auto asterisk would be awesome.. for php there are snippets for phpdoc already. I found this but don't know how to get it to work for sublime text 2. I think it does the auto asterisk.


<binding key="enter" command="insertInlineSnippet '\n*$0'">   <context name="selector" value="comment.block.documentation.phpdoc.php"/>   <context name="allPrecedingText" value="\*"/></binding>

<binding key="enter" command="insertInlineSnippet '\n *$0'">   <context name="selector" value="comment.block.documentation.phpdoc.php"/>   <context name="allPrecedingText" value="/\*\*"/></binding>
<binding key="enter" command="insertInlineSnippet '*$0\n'">   <context name="selector" value="comment.block.documentation.phpdoc.php"/>   <context name="allFollowingCharacter" value="*"/></binding>