branch: elpa/typescript-mode
commit 30f8b8feb45516e2c20ef984ca15e076b41b97f7
Merge: 39b7ba9e54 a1cdb7a1ec
Author: Jostein Kjønigsen <[email protected]>
Commit: GitHub <[email protected]>
Merge pull request #87 from Ailrun/add-jsdoc-tags
Add more jsdoc tags
---
typescript-mode.el | 76 +++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 58 insertions(+), 18 deletions(-)
diff --git a/typescript-mode.el b/typescript-mode.el
index 1718419df5..9d2ef766bc 100644
--- a/typescript-mode.el
+++ b/typescript-mode.el
@@ -422,7 +422,13 @@ Match group 1 is MUMBLE.")
(defconst typescript-jsdoc-param-tag-regexp
(concat typescript-jsdoc-before-tag-regexp
"\\(@"
- "\\(?:param\\|arg\\(?:ument\\)?\\|prop\\(?:erty\\)?\\)"
+ (regexp-opt
+ '("arg"
+ "argument"
+ "param"
+ "prop"
+ "property"
+ "typedef"))
"\\)"
"\\s-*\\({[^}]+}\\)?" ; optional type
"\\s-*\\[?\\([[:alnum:]_$\.]+\\)?\\]?" ; name
@@ -430,9 +436,10 @@ Match group 1 is MUMBLE.")
"Matches jsdoc tags with optional type and optional param name.")
;; This was taken from js2-mode.
+;; and extended with tags in http://usejsdoc.org/
(defconst typescript-jsdoc-typed-tag-regexp
(concat typescript-jsdoc-before-tag-regexp
- "\\(@\\(?:"
+ "\\(@"
(regexp-opt
'("enum"
"extends"
@@ -446,55 +453,75 @@ Match group 1 is MUMBLE.")
"returns"
"throw"
"throws"
- "type"))
- "\\)\\)\\s-*\\({[^}]+}\\)?")
+ "type"
+ "yield"
+ "yields"))
+ "\\)\\s-*\\({[^}]+}\\)?")
"Matches jsdoc tags with optional type.")
;; This was taken from js2-mode.
+;; and extended with tags in http://usejsdoc.org/
(defconst typescript-jsdoc-arg-tag-regexp
(concat typescript-jsdoc-before-tag-regexp
- "\\(@\\(?:"
+ "\\(@"
(regexp-opt
- '("alias"
+ '("access"
+ "alias"
"augments"
+ "base"
"borrows"
- "callback"
"bug"
- "base"
+ "callback"
"config"
"default"
"define"
"emits"
"exception"
+ "extends"
+ "external"
"fires"
"func"
"function"
+ "host"
+ "kind"
+ "listens"
"member"
- "memberOf"
+ "memberof"
"method"
+ "mixes"
+ "module"
"name"
"namespace"
+ "requires"
"since"
"suppress"
"this"
"throws"
+ "var"
+ "variation"
"version"))
- "\\)\\)\\s-+\\([^ \t]+\\)")
+ "\\)\\s-+\\([^ \t]+\\)")
"Matches jsdoc tags with a single argument.")
-;; This was taken from js2-mode.
+;; This was taken from js2-mode
+;; and extended with tags in http://usejsdoc.org/
(defconst typescript-jsdoc-empty-tag-regexp
(concat typescript-jsdoc-before-tag-regexp
- "\\(@\\(?:"
+ "\\(@"
(regexp-opt
- '("addon"
+ '("abstract"
+ "addon"
+ "async"
"author"
"class"
+ "classdesc"
"const"
"constant"
"constructor"
"constructs"
"copyright"
+ "default"
+ "defaultvalue"
"deprecated"
"desc"
"description"
@@ -502,32 +529,45 @@ Match group 1 is MUMBLE.")
"example"
"exec"
"export"
+ "exports"
+ "file"
"fileoverview"
"final"
"func"
"function"
+ "generator"
+ "global"
"hidden"
+ "hideconstructor"
"ignore"
- "implicitCast"
- "inheritDoc"
+ "implicitcast"
+ "inheritdoc"
"inner"
+ "instance"
"interface"
"license"
"method"
+ "mixin"
"noalias"
"noshadow"
"notypecheck"
"override"
+ "overview"
"owner"
+ "package"
"preserve"
- "preserveTry"
+ "preservetry"
"private"
"protected"
"public"
+ "readonly"
"static"
+ "summary"
"supported"
- ))
- "\\)\\)\\s-*")
+ "todo"
+ "tutorial"
+ "virtual"))
+ "\\)\\s-*")
"Matches empty jsdoc tags.")
;; Note that this regexp by itself would match tslint flags that appear inside