@@ -315,12 +315,13 @@ See `cider-connection-capabilities'."
315
315
(_ '()))
316
316
(when
317
317
(or
318
- (member cider-repl-type '( cljs pending-cljs) )
318
+ (eq cider-repl-type 'cljs )
319
319
; ; This check is currently basically for nbb.
320
320
; ; See `cider-sync-tooling-eval' , but it is defined on a higher layer
321
- (nrepl-dict-get
322
- (nrepl-sync-request:eval " cljs.core/demunge" (current-buffer ) (cider-current-ns) 'tooling )
323
- " value" ))
321
+ (progn
322
+ (nrepl-dict-get
323
+ (nrepl-sync-request:eval " cljs.core/demunge" (current-buffer ) nil 'tooling )
324
+ " value" )))
324
325
'(cljs))))))
325
326
326
327
(declare-function cider--debug-init-connection " cider-debug" )
@@ -762,10 +763,17 @@ Session name can be customized with `cider-session-name-template'."
762
763
(defvar-local cider-repl-type nil
763
764
" The type of this REPL buffer, usually either clj or cljs." )
764
765
766
+ (defvar-local cider-cljs-repl-pending nil
767
+ " Is the cljs repl currently pending?" )
768
+
765
769
(defun cider-repl-type (repl-buffer )
766
770
" Get REPL-BUFFER's type."
767
771
(buffer-local-value 'cider-repl-type repl-buffer))
768
772
773
+ (defun cider-cljs-pending-p (repl-buffer )
774
+ " Returns non nil when REPL-BUFFER is currently a pending cljs repl."
775
+ (buffer-local-value 'cider-cljs-repl-pending repl-buffer))
776
+
769
777
(defun cider-repl-type-for-buffer (&optional buffer )
770
778
" Return the matching connection type (clj or cljs) for BUFFER.
771
779
BUFFER defaults to the `current-buffer' . In cljc buffers return
@@ -812,13 +820,13 @@ PARAMS is a plist as received by `cider-repl-create'."
812
820
(let* ((proj-dir (plist-get params :project-dir ))
813
821
(host (plist-get params :host ))
814
822
(port (plist-get params :port ))
815
- (cljsp (member (plist-get params :repl-type ) '(cljs pending-cljs )))
823
+ (cljsp (member (plist-get params :repl-type ) '(cljs)))
816
824
(scored-repls
817
825
(delq nil
818
826
(mapcar (lambda (b )
819
827
(let ((bparams (cider--gather-connect-params nil b)))
820
828
(when (eq cljsp (member (plist-get bparams :repl-type )
821
- '(cljs pending-cljs )))
829
+ '(cljs)))
822
830
(cons (buffer-name b)
823
831
(+
824
832
(if (equal proj-dir (plist-get bparams :project-dir )) 8 0 )
@@ -866,8 +874,9 @@ function with the repl buffer set as current."
866
874
mode-name nil
867
875
cider-session-name ses-name
868
876
nrepl-project-dir (plist-get params :project-dir )
869
- ; ; REPLs start with clj and then "upgrade" to a different type
877
+ ; ; Cljs repls are pending until they are upgraded. See cider-repl--state-handler
870
878
cider-repl-type (plist-get params :repl-type )
879
+ cider-cljs-repl-pending (plist-get params :cider-cljs-repl-pending )
871
880
; ; ran at the end of cider--connected-handler
872
881
cider-repl-init-function (plist-get params :repl-init-function )
873
882
cider-launch-params params)
@@ -985,7 +994,9 @@ throw an error if no linked session exists."
985
994
(sesman-ensure-session 'CIDER )
986
995
(sesman-current-session 'CIDER )))))))
987
996
(or (seq-filter (lambda (b )
988
- (cider--match-repl-type type b))
997
+ (unless
998
+ (cider-cljs-pending-p b)
999
+ (cider--match-repl-type type b)))
989
1000
repls)
990
1001
(when ensure
991
1002
(cider--no-repls-user-error type)))))
0 commit comments