Skip to content

Commit 98d172a

Browse files
committed
Add groovy and js writer.
1 parent 5420334 commit 98d172a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

docstr-writers.el

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ Argument START is the starting point ot the insertion."
344344
(docstr-writers--insert-return return-type-str nil prefix)
345345
(docstr-writers-after start)))))
346346

347+
(defun docstr-writers-groovy (search-string)
348+
"Insert document string for Groovy using SEARCH-STRING."
349+
(docstr-writers-javascript search-string))
350+
347351
(defun docstr-writers-java (search-string)
348352
"Insert document string for Java using SEARCH-STRING."
349353
(let* ((start (point)) (prefix "\n* ")
@@ -356,6 +360,16 @@ Argument START is the starting point ot the insertion."
356360
(docstr-writers--insert-return return-type-str '("void") prefix)
357361
(docstr-writers-after start)))
358362

363+
(defun docstr-writers-javascript (search-string)
364+
"Insert document string for JavaScript using SEARCH-STRING."
365+
(let* ((start (point)) (prefix "\n* ")
366+
(paren-param-list (docstr-writers--paren-param-list search-string))
367+
(param-types (nth 0 paren-param-list))
368+
(param-vars (nth 1 paren-param-list)))
369+
(docstr-writers--insert-param param-types param-vars prefix)
370+
(docstr-writers--insert-return nil '("void") prefix)
371+
(docstr-writers-after start)))
372+
359373
(defun docstr-writers-lua (search-string)
360374
"Insert document string for Lua using SEARCH-STRING."
361375
(let* ((start (point)) (prefix "\n-- ")

docstr.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,8 @@
103103
(defun docstr--get-type-name (type)
104104
"Return TYPE's name."
105105
(if (not docstr-show-type-name) ""
106-
(when (string-empty-p type) (setq type docstr-default-typename))
106+
(when (or (null type) (string-empty-p type))
107+
(setq type docstr-default-typename))
107108
(format docstr-format-type type)))
108109

109110
(defun docstr--get-var-name (var)

0 commit comments

Comments
 (0)