Skip to content

Commit

Permalink
nrepl: when listing compilers put current session compilers first
Browse files Browse the repository at this point in the history
  • Loading branch information
darwin committed Sep 28, 2016
1 parent f0b58b3 commit d9e1f87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nrepl/dirac/nrepl/compilers.clj
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@
; -- all compilers in the process -------------------------------------------------------------------------------------------

(defn collect-all-available-compiler-descriptors []
(let [dirac-compilers (mapcat extract-session-compiler-descriptors @state/session-descriptors)
(let [session-compilers (state/get-session-compiler-descriptors)
other-sessions-compilers (mapcat extract-session-compiler-descriptors (sessions/get-other-sessions-descriptors))
figwheel-compilers (figwheel/collect-available-compiler-descriptors)]
(concat figwheel-compilers dirac-compilers)))
(concat session-compilers other-sessions-compilers figwheel-compilers))) ; order is important here, we are matching compilers in this order

(defn compiler-descriptors-ids [descriptors]
(vec (map get-compiler-descriptor-id descriptors)))
Expand Down
6 changes: 6 additions & 0 deletions src/nrepl/dirac/nrepl/sessions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
(defn get-dirac-session-tags []
(get-dirac-session-descriptors-tags @state/session-descriptors))

(defn get-other-sessions-descriptors
([] (get-other-sessions-descriptors (state/get-current-session)))
([session]
(assert session)
(remove #(= session (get-dirac-session-descriptor-session %)) @state/session-descriptors)))

; -- joining sessions -------------------------------------------------------------------------------------------------------

(defn make-joined-session-descriptor [matcher-fn info]
Expand Down

0 comments on commit d9e1f87

Please sign in to comment.