Skip to content

Commit

Permalink
Return nothing for hinting if an exception occurs in trying to genera…
Browse files Browse the repository at this point in the history
…te a hint
  • Loading branch information
stephenbrady committed Jul 3, 2016
1 parent 5794c3b commit 4a6b256
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lein-light-nrepl/src/lighttable/nrepl/auto_complete.clj
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,15 @@
(cljs-hints-for-ns (symbol ns-name) nss)))

(defmethod core/handle "editor.clj.hints" [{:keys [session ns path] :as msg}]
(let [ns (eval/normalize-ns ns path)]
(core/respond msg "editor.clj.hints.result" (clj-hints ns) "json")
(let [ns (eval/normalize-ns ns path)
hints (try (clj-hints ns)
(catch Throwable t [""]))]
(core/respond msg "editor.clj.hints.result" hints "json")
@session))

(defmethod core/handle "editor.cljs.hints" [{:keys [session ns path] :as msg}]
(let [ns (eval/normalize-ns ns path)]
(core/respond msg "editor.clj.hints.result" (cljs-hints ns) "json")
(let [ns (eval/normalize-ns ns path)
hints (try (cljs-hints ns)
(catch Throwable t [""]))]
(core/respond msg "editor.clj.hints.result" hints "json")
@session))

0 comments on commit 4a6b256

Please sign in to comment.