@@ -93,6 +93,11 @@ text, and below the Examples section."
93
93
:group 'numpydoc
94
94
:type 'string )
95
95
96
+ (defcustom numpydoc-template-type-desc " FIXME: Add type."
97
+ " Template text for individual component type descriptions."
98
+ :group 'numpydoc
99
+ :type 'string )
100
+
96
101
; ;; package implementation code.
97
102
98
103
(cl-defstruct numpydoc--def
@@ -329,6 +334,16 @@ This function assumes the cursor to be in the function body."
329
334
(format " %s : %s \n " name type)
330
335
(format " %s \n " name))))
331
336
337
+ (defun numpydoc--insert-item-and-type (indent name type )
338
+ " Insert parameter with NAME and TYPE at level INDENT."
339
+ (let ((tp type))
340
+ (unless tp
341
+ (setq tp (if numpydoc-prompt-for-input
342
+ (read-string (format " Type of %s : "
343
+ name))
344
+ numpydoc-template-type-desc)))
345
+ (numpydoc--insert indent (format " %s : %s \n " name tp))))
346
+
332
347
(defun numpydoc--insert-item-desc (indent element )
333
348
" Insert ELEMENT parameter description at level INDENT."
334
349
(let ((desc (concat (make-string 4 ?\s )
@@ -348,9 +363,9 @@ This function assumes the cursor to be in the function body."
348
363
" Parameters\n "
349
364
" ----------\n " )
350
365
(dolist (element fnargs)
351
- (numpydoc--insert-item indent
352
- (numpydoc--arg-name element)
353
- (numpydoc--arg-type element))
366
+ (numpydoc--insert-item-and-type indent
367
+ (numpydoc--arg-name element)
368
+ (numpydoc--arg-type element))
354
369
(numpydoc--insert-item-desc indent
355
370
(numpydoc--arg-name element)))))
356
371
0 commit comments