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