Permalink
Browse files

Merge branch 'release/2.6.4'

  • Loading branch information...
2 parents 85fd316 + 8e5f16b commit f9f4aa6747915fc09f3484d74f13bc7acc2c86e3 @spadgos committed Jun 5, 2012
Showing with 104 additions and 36 deletions.
  1. +37 −7 Default.sublime-keymap
  2. +5 −0 HISTORY.md
  3. +29 −26 README.md
  4. +20 −2 js.sublime-completions
  5. +13 −1 jsdocs.py
View
@@ -33,18 +33,48 @@
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n${TM_CURRENT_LINE/^\\s*(\\*\\s*).*$/$1/}"}, "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*\\s*\\S", "match_all": true }
+ ]
+ },
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n${TM_CURRENT_LINE/^\\s*(\\*\\s*).*$/$1/}"}, "context":
+ [
+ { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
+ { "key": "setting.trim_automatic_white_space", "operator": "equal", "operand": false },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*", "match_all": true }
]
},
+ { "keys": ["enter"], "command": "jsdocs_trim_auto_whitespace", "context":
+ [
+ { "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
+ { "key": "setting.trim_automatic_white_space", "operator": "equal", "operand": true, "match_all": true },
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*\\s*$", "match_all": true }
+ ]
+ },
{ "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n${TM_CURRENT_LINE/^\\s*(\\/\\/\\s*).*$/$1/}"}, "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
{ "key": "setting.jsdocs_extend_double_slash", "operator": "equal", "operand": true, "match_all": true},
- { "key": "selector", "operator" : "equal", "operand" : "comment.line.double-slash", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.line.double-slash", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
- { "key": "preceding_text", "operator" : "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
+ ]
+ },
+ { "keys": ["enter"], "command": "insert_snippet", "args": {"contents": "\n$0\n */"}, "context":
+ [
+ { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true},
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\*$", "match_all": true}
+ ]
+ },
+ { "keys": ["*"], "command": "insert_snippet", "args": {"contents": " *"}, "context":
+ [
+ { "key": "selector", "operator": "equal", "operand": "comment.block", "match_all": true},
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*$", "match_all": true}
]
},
{ "keys": ["enter"], "command": "jsdocs_deindent", "context":
@@ -70,7 +100,7 @@
{ "keys": ["keypad_enter"], "command": "insert_snippet", "args": {"contents": "\n${TM_CURRENT_LINE/^\\s*(\\*\\s*).*$/$1/}"}, "context":
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\*", "match_all": true }
]
@@ -79,16 +109,16 @@
[
{ "key": "setting.auto_indent", "operator": "equal", "operand": true, "match_all": true },
{ "key": "setting.jsdocs_extend_double_slash", "operator": "equal", "operand": true, "match_all": true},
- { "key": "selector", "operator" : "equal", "operand" : "comment.line.double-slash", "match_all": true},
+ { "key": "selector", "operator": "equal", "operand" : "comment.line.double-slash", "match_all": true},
{ "key": "auto_complete_visible", "operator": "equal", "operand": false, "match_all": true },
- { "key": "preceding_text", "operator" : "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
+ { "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*\\/\\/", "match_all": true}
]
},
{ "keys": ["@"], "command": "run_macro_file", "args": {"file": "Packages/DocBlockr/jsdocs-auto-complete.sublime-macro"}, "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true },
{ "key": "preceding_text", "operator": "regex_contains", "operand": "^\\s*(?:\\*|\\/\\*{2})\\s*$", "match_all": true },
- { "key": "selector", "operator" : "equal", "operand" : "comment.block", "match_all": true}
+ { "key": "selector", "operator": "equal", "operand" : "comment.block", "match_all": true}
]
},
{ "keys": ["tab"], "command": "jsdocs_indent", "context":
View
@@ -1,5 +1,10 @@
# DocBlockr Extended Changelog
+- **v2.6.4**, *4 June 2012*
+ - Better support for indentation using tabs
+ - YUI tags are supported by the autocomplete
+ - When only whitespace exists on a docblock line, and `trim_automatic_white_space` is set to true, the whitespace is removed.
+ - Better support for comment blocks opened with `/*`
- **v2.6.3**, *30 April 2012*
- Fixes the join-lines command <kbd>Ctrl+J</kbd> for CoffeeScript.
- **v2.6.2**, *22 March 2012*
View
@@ -23,6 +23,11 @@ Download the latest version from the [tags page][tags]. Unzip to your Sublime Te
You can leave either of these things [here][issues].
## Changelog ##
+- **v2.6.4**, *4 June 2012*
+ - Better support for indentation using tabs
+ - YUI tags are supported by the autocomplete
+ - When only whitespace exists on a docblock line, and `trim_automatic_white_space` is set to true, the whitespace is removed.
+ - Better support for comment blocks opened with `/*`
- **v2.6.3**, *30 April 2012*
- Fixes the join-lines command <kbd>Ctrl+J</kbd> for CoffeeScript.
- **v2.6.2**, *22 March 2012*
@@ -32,8 +37,6 @@ You can leave either of these things [here][issues].
- `@return` tags are now given a description field *(thanks to [Nick Dowdell](https://github.com/mikulad13))*.
- **v2.6.0**, *4 March 2012*
- Added CoffeeScript support
-- **v2.5.0**, *11 February 2012*
- - Implemented DocBlock reparsing to re-enable tabstop fields. Hotkey is `Ctrl+Alt+Tab`.
Older history can be found in [the history file](https://github.com/spadgos/sublime-jsdocs/blob/master/HISTORY.md).
@@ -53,6 +56,28 @@ Pressing **enter** or **tab** after `/**` (or `#***` for Coffee-Script) will yie
* |
*/
+Single-asterisk comment blocks behave similarly:
+
+ /*<<enter>
+
+ -- becomes --
+
+ /*
+ |
+ */
+
+If you press asterisk on the first line, it becomes indented with the line above:
+
+ /*
+ |<<*>>
+ */
+
+ /*
+ *|
+ */
+
+### Function documentation ###
+
However, if the line directly afterwards contains a function definition, then its name and parameters are parsed and some documentation is automatically added.
/**<<enter>>
@@ -213,30 +238,7 @@ With DocBlockr, you can reparse a comment and reactivate the fields by pressing
### Adding extra tags ###
-Finally, typing `@` inside a docblock will show a completion list for all tags supported by [JSDoc][jsdoc], the [Google Closure Compiler][closure] or [PHPDoc][phpdoc]. Extra help is provided for each of these tags by prefilling the arguments each expects. Pressing `tab` will move the cursor to the next argument.
-
-Exhaustively, these tags are:
-
- @param @return @returns @author
- @abstract @access @augments
- @borrows
- @category @class @const @constant @constructor @constructs @copyright
- @default @define @deprecated @description
- @enum @event @example @extends
- @field @fileOverview @filesource @final @function
- @global
- @ignore @implements @inheritDoc @inner @interface @internal
- @lends @license @link
- @memberOf @method
- @name @namespace @nosideeffects
- @override
- @package @preserve @private @property @protected @public
- @requires
- @see @since @static @staticvar @subpackage
- @this @throws @todo @tutorial @type @typedef
- @uses
- @var @version
-
+Finally, typing `@` inside a docblock will show a completion list for all tags supported by [JSDoc][jsdoc], the [Google Closure Compiler][closure], [YUIDoc][yui] or [PHPDoc][phpdoc]. Extra help is provided for each of these tags by prefilling the arguments each expects. Pressing `tab` will move the cursor to the next argument.
## Configuration ##
@@ -315,3 +317,4 @@ This is my first package for Sublime Text, and the first time I've written any P
[svenax]: https://github.com/svenax
[tags]: https://github.com/spadgos/sublime-jsdocs/tags
[typehinting]: http://php.net/manual/en/language.oop5.typehinting.php
+[yui]: http://yui.github.com/yuidoc/syntax/index.html
View
@@ -2,9 +2,14 @@
"scope": "source.js comment.block.documentation",
"completions":
[
+ { "trigger" : "@async", "contents": ""},
{ "trigger" : "@augments", "contents": "@augments {${1:[type]}}"},
- { "trigger" : "@author", "contents": "@author ${1:[author]}" },
+ { "trigger" : "@attribute", "contents": "@attribute ${1:[name]}"},
+ { "trigger" : "@author", "contents": "@author ${1:[author]}"},
+ { "trigger" : "@beta", "contents": ""},
{ "trigger" : "@borrows", "contents": "@borrows ${1:[otherMemberName]} as ${2:[thisMemberName]}"},
+ { "trigger" : "@bubbles", "contents": "@bubbles ${1:[name]}"},
+ { "trigger" : "@chainable", "contents": ""},
{ "trigger" : "@class", "contents": "@class ${1:[description]}"},
{ "trigger" : "@const", "contents": ""},
{ "trigger" : "@constant", "contents": ""},
@@ -19,8 +24,13 @@
{ "trigger" : "@event", "contents": ""},
{ "trigger" : "@example", "contents": "@example\n* "},
{ "trigger" : "@extends", "contents": "@extends {${1:[type]}}"},
+ { "trigger" : "@extension", "contents": "@extension ${1:[class]}"},
+ { "trigger" : "@extensionfor", "contents": "@extensionfor ${1:[class]}"},
+ { "trigger" : "@extension_for", "contents": "@extension_for ${1:[class]}"},
{ "trigger" : "@field", "contents": ""},
{ "trigger" : "@fileOverview", "contents": "@fileOverview ${1:[description]}"},
+ { "trigger" : "@final", "contents": ""},
+ { "trigger" : "@for", "contents": "@for ${1:[class]}"},
{ "trigger" : "@function", "contents": ""},
{ "trigger" : "@ignore", "contents": ""},
{ "trigger" : "@implements", "contents": "@implements {${1:[type]}}"},
@@ -30,10 +40,14 @@
{ "trigger" : "@internal", "contents": "@internal ${1:[private description]}"},
{ "trigger" : "@lends", "contents": "@lends ${1:[symbolAlias]}"},
{ "trigger" : "@license", "contents": "@license ${1:[url]} ${2:[description]}"},
- { "trigger" : "@memberOf", "contents": "@memberOf ${1:parentNamePath"},
+ { "trigger" : "@main", "contents": "@main ${1:[module name]}"},
+ { "trigger" : "@memberOf", "contents": "@memberOf ${1:[parentNamePath]}"},
+ { "trigger" : "@method", "contents": "@method ${1:[name]}"},
+ { "trigger" : "@module", "contents": "@module ${1:[module name]}"},
{ "trigger" : "@name", "contents": "@name {$1:[name]}"},
{ "trigger" : "@namespace", "contents": "@namespace ${1:[description]}"},
{ "trigger" : "@nosideeffects", "contents": ""},
+ { "trigger" : "@optional", "contents": ""},
{ "trigger" : "@override", "contents": "@override"},
{ "trigger" : "@package", "contents": "@package ${1:[name]}"},
{ "trigger" : "@param", "contents": "@param {${1:[type]}} ${2:[varname]} ${3:[description]}" },
@@ -42,12 +56,15 @@
{ "trigger" : "@property", "contents": "@property {${1:[type]}} ${2:[propName]} ${3:[description]}"},
{ "trigger" : "@protected", "contents": ""},
{ "trigger" : "@public", "contents": ""},
+ { "trigger" : "@readOnly", "contents": ""},
+ { "trigger" : "@required", "contents": ""},
{ "trigger" : "@requires", "contents": "@requires ${1:[description]}"},
{ "trigger" : "@return", "contents": "@return {${1:[type]}} ${2:[description]}" },
{ "trigger" : "@returns", "contents": "@returns {${1:[type]}} ${2:[description]}" },
{ "trigger" : "@see", "contents": "@see ${1:[description]}"},
{ "trigger" : "@since", "contents": "@since ${1:[version]}"},
{ "trigger" : "@static", "contents": ""},
+ { "trigger" : "@sumodule", "contents": "@submodule ${1:[submodule]}"},
{ "trigger" : "@subpackage", "contents": "@subpackage ${1:[name]}"},
{ "trigger" : "@this", "contents": "@this {${1:[type]}}"},
{ "trigger" : "@throws", "contents": "@throws {${1:[exceptionType]}} If ${2:[this condition is met]}"},
@@ -58,6 +75,7 @@
{ "trigger" : "@uses", "contents": "@uses ${1:[object]} ${2:[description]}"},
{ "trigger" : "@var", "contents": "@var {${1:[type]}} ${2:[description]}"},
{ "trigger" : "@version", "contents": "@version ${1:[version]}"},
+ { "trigger" : "@writeOnce", "contents": ""},
{ "trigger" : "{@link}", "contents": "{@link ${1:[symbol]}}"}
]
}
View
@@ -610,7 +610,7 @@ def run(self, edit):
v = self.view
lineRegion = v.line(v.sel()[0])
line = v.substr(lineRegion)
- v.insert(edit, lineRegion.end(), re.sub("^(\\s*) \\*/.*", "\n\\1", line))
+ v.insert(edit, lineRegion.end(), re.sub("^(\\s*)\\s\\*/.*", "\n\\1", line))
class JsdocsReparse(sublime_plugin.TextCommand):
@@ -636,3 +636,15 @@ def tabStop(m):
v.erase(edit, sel)
write(v, text)
+
+
+class JsdocsTrimAutoWhitespace(sublime_plugin.TextCommand):
+ """
+ Trim the automatic whitespace added when creating a new line in a docblock.
+ """
+ def run(self, edit):
+ v = self.view
+ lineRegion = v.line(v.sel()[0])
+ line = v.substr(lineRegion)
+ spaces = max(0, v.settings().get("jsdocs_indentation_spaces", 1))
+ v.replace(edit, lineRegion, re.sub("^(\\s*\\*)\\s*$", "\\1\n\\1" + (" " * spaces), line))

0 comments on commit f9f4aa6

Please sign in to comment.