Closed katomuso closed 4 weeks ago
To easily verify that it doesn't change the output, you can use the following snippet:
(let* ((info (cider-var-info "clojure.core/reduce"))
(doc (nrepl-dict-get info "doc")))
(string= (cider-docstring--dumb-trim doc)
(cider-docstring--trim (cider-docstring--format doc))))
Thanks!
The function
cider-docstring--dumb-trim
performs both formatting and trimming. I propose splitting it into two separate functions:cider-docstring--trim
andcider-docstring--format
because these two functionalities are needed in different contexts. For example, we need to format the docstring when displaying it in the documentation buffer, and we need to trim the docstring when displaying it in the minibuffer or in a popup along with completions.