|
323 | 323 | (defn maybe-connect-emacs [{:keys [options nrepl-port project-root] :as ctx}]
|
324 | 324 | (when (:cider-connect options)
|
325 | 325 | (debug "Connecting CIDER with project-dir" project-root)
|
326 |
| - (eval-emacs |
327 |
| - `(~'let ((~'repl (~'cider-connect-clj (~'list |
328 |
| - :host "localhost" |
329 |
| - :port ~nrepl-port |
330 |
| - :project-dir ~project-root)))) |
331 |
| - |
332 |
| - ~@(for [build-id (:shadow-cljs/build-ids ctx) |
333 |
| - :let [init-sym (symbol "launchpad" (name build-id))]] |
334 |
| - `(~'progn |
335 |
| - (~'setf (~'alist-get '~init-sym |
336 |
| - ~'cider-cljs-repl-types) |
337 |
| - (~'list ~(pr-str |
338 |
| - `(shadow.cljs.devtools.api/nrepl-select ~build-id)))) |
339 |
| - (~'cider-connect-sibling-cljs (~'list |
340 |
| - :cljs-repl-type '~init-sym |
341 |
| - :host "localhost" |
342 |
| - :port ~nrepl-port |
343 |
| - :project-dir ~project-root))))))) |
| 326 | + (try |
| 327 | + (eval-emacs |
| 328 | + `(~'let ((~'repl (~'cider-connect-clj (~'list |
| 329 | + :host "localhost" |
| 330 | + :port ~nrepl-port |
| 331 | + :project-dir ~project-root)))) |
| 332 | + |
| 333 | + ~@(for [build-id (:shadow-cljs/build-ids ctx) |
| 334 | + :let [init-sym (symbol "launchpad" (name build-id))]] |
| 335 | + `(~'progn |
| 336 | + (~'setf (~'alist-get '~init-sym |
| 337 | + ~'cider-cljs-repl-types) |
| 338 | + (~'list ~(pr-str |
| 339 | + `(shadow.cljs.devtools.api/nrepl-select ~build-id)))) |
| 340 | + (~'cider-connect-sibling-cljs (~'list |
| 341 | + :cljs-repl-type '~init-sym |
| 342 | + :host "localhost" |
| 343 | + :port ~nrepl-port |
| 344 | + :project-dir ~project-root)))))) |
| 345 | + (catch java.io.IOException e |
| 346 | + (warn "Attempt to connect to emacs failed with exception: " (ex-message e))))) |
344 | 347 | ctx)
|
345 | 348 |
|
346 | 349 | (defn print-summary [ctx]
|
|
0 commit comments