Skip to content

Commit

Permalink
Doc Hover: "no doc" message for local symbol (instead of Exception)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentpetit committed Dec 26, 2012
1 parent a3cbbc2 commit b85db55
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions ccw.util/src/clj/ccw/util/doc_utils.clj
Expand Up @@ -26,13 +26,15 @@
:text (format "%s:\n%s" title body)))

(defn render-identity [renderer name ns]
(condp = renderer
:html (format "<b>%s</b> %s" name (or ns ""))
:text (format "%s %s" name (or ns ""))))
(when-not (str/blank? name)
(condp = renderer
:html (format "<b>%s</b> %s" name (or ns ""))
:text (format "%s %s" name (or ns "")))))

(defn- render-sections [renderer sections no-sections-text]
(let [s (condp = renderer
:html (apply str (mapcat vector (repeat "<p>") (keep identity sections) (repeat "</p>")))
:html (when-let [sections (keep identity sections)]
(apply str (mapcat vector (repeat "<p>") sections (repeat "</p>"))))
:text (str/join "\n\n" (keep identity sections)))]
(if (str/blank? s)
(condp = renderer
Expand All @@ -55,7 +57,7 @@
(str "(" optional-meta ")"))))

(defn header-doc [renderer {:keys [name ns] :as m}]
(when name
(when-not (str/blank? name)
(render-lines renderer
[(render-identity renderer name ns)
(optional-meta m)])))
Expand Down

0 comments on commit b85db55

Please sign in to comment.