-
Notifications
You must be signed in to change notification settings - Fork 0
/
js-doc.elc
63 lines (57 loc) · 10.5 KB
/
js-doc.elc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
;ELC
;;; Compiled by shant@ultraio on Sat Sep 27 19:36:33 2014
;;; from file /home/shant/.emacs.d/js-doc.el
;;; in Emacs version 24.3.1
;;; with all optimizations.
;;; This file uses dynamic docstrings, first added in Emacs 19.29.
;;; This file does not contain utf-8 non-ASCII characters,
;;; and so can be loaded in Emacs versions earlier than 23.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(byte-code "\300\301\302\303\304\305\306\307&\210\310\311\312\313\304\301%\210\310\314\312\315\304\301%\210\310\316\312\317\304\301%\210\310\320\312\321\304\301%\207" [custom-declare-group js-doc nil "Insert JsDoc style comment easily." :group comment :prefix "js-doc" custom-declare-variable js-doc-mail-address "" "Author's E-mail address." js-doc-author "Author of the source code." js-doc-license "License of the source code." js-doc-url "Author's Home page URL."] 8)
#@64 JsDoc tag list
This list contains tag name and its description
(defvar js-doc-all-tag-alist '(("augments" . "Indicate this class uses another class as its \"base.\"") ("author" . "Indicate the author of the code being documented.") ("argument" . "Deprecated synonym for @param.") ("borrows that as this" . "Document that class's member as if it were a member of this class.") ("class" . "Provide a description of the class (versus the constructor).") ("constant" . "Indicate that a variable's value is a constant.") ("constructor" . "Identify a function is a constructor.") ("constructs" . "Identicate that a lent function will be used as a constructor.") ("default" . "Describe the default value of a variable.") ("deprecated" . "Indicate use of a variable is no longer supported.") ("description" . "Provide a description (synonym for an untagged first-line).") ("event" . "Describe an event handled by a class.") ("example" . "Provide a small code example, illustrating usage.") ("extends" . "Synonym for @augments.") ("field" . "Indicate that the variable refers to a non-function.") ("fileOverview" . "Provides information about the entire file.") ("function" . "Indicate that the variable refers to a function.") ("ignore" . "Indicate JsDoc Toolkit should ignore the variable.") ("inner" . "Indicate that the variable refers to an inner function (and so is also @private).") ("lends" . "Document that all an object literal's members are members of a given class.") ("license" . "License of the source code.") ("link" . "Like @see but can be used within the text of other tags.") ("method" . "Provide a description of the method") ("memberOf" . "Document that this variable refers to a member of a given class.") ("name" . "Force JsDoc Toolkit to ignore the surrounding code and use the given variable name instead.") ("namespace" . "Document an object literal is being used as a \"namespace.\"") ("param" . "Describe a function's parameter.") ("private" . "Indicate a variable is private (use the -p command line option to include these).") ("property" . "Document a property of a class from within the constructor's doclet.") ("public" . "Indicate an inner variable is public.") ("requires" . "Describe a required resource.") ("returns" . "Describe the return value of a function.") ("see" . "Describe a related resource.") ("since" . "Indicate that a feature has only been available on and after a certain version number.") ("static" . "Indicate that accessing the variable does not require instantiation of its parent.") ("throws" . "Describe the exception that a function might throw.") ("type" . "Describe the expected type of a variable's value or the value returned by a function.") ("version" . "Indicate the release version of this code.")) (#$ . 973))
#@188 JsDoc style file document format.
When the `js-doc-insert-file-doc' is called,
each lines in a list will be formatted by `js-doc-format-string'
and inserted to the top of current buffer.
(defvar js-doc-file-doc-lines '(js-doc-top-line " * @fileOverview\n" " * @name %F\n" " * @author %a\n" " * @license %l\n" js-doc-bottom-line) (#$ . 3748))
#@83 Format and value pair
Format will be replaced its value in `js-doc-format-string'
(defvar js-doc-format-string-alist '(("%F" buffer-name) ("%P" buffer-file-name) ("%a" . js-doc-author) ("%l" . js-doc-license) ("%d" current-time-string) ("%p" . js-doc-current-parameter-name) ("%f" . js-doc-current-function-name)) (#$ . 4096))
(byte-code "\300\301\302\303\304\305%\210\300\306\307\310\304\305%\210\300\311\312\313\304\305%\210\300\314\315\316\304\305%\210\300\317\320\321\304\305%\210\300\322\323\324\304\305%\210\300\325\326\313\304\305%\210\300\327\330\331\304\305%\210\300\332\333\334\304\305%\210\300\335\336\337\304\305%\207" [custom-declare-variable js-doc-top-line "/**\n" "top line of the js-doc style comment." :group js-doc js-doc-description-line " * \n *\n" "description line." js-doc-bottom-line " */\n" "bottom line." js-doc-method-line " * @method %f\n" "method line.\n %f will be replaced with the method name" js-doc-parameter-line " * @param {} %p\n" "parameter line.\n %p will be replaced with the parameter name." js-doc-return-line " * @returns {} \n" "return line." js-doc-throw-line " * @throws {} \n" js-doc-return-regexp "return " "regular expression of return\nWhen the function body contains this pattern,\njs-doc-return-line will be inserted" js-doc-throw-regexp "throw" "regular expression of throw\nWhen the function body contains this pattern,\njs-doc-throw-line will be inserted" js-doc-document-regexp "^[ ]*\\*[^//]" "regular expression of JsDoc comment\nWhen the string ahead of current point matches this pattarn,\njs-doc regards current state as in JsDoc style comment"] 6)
#@155 Format given string and return its result
%F => file name
%P => file path
%a => author name
%d => current date
%p => parameter name
%f => function name
(defalias 'js-doc-format-string #[(fmt) "\305 \305\211\203&