Skip to content

Commit

Permalink
Small fixes for Clojure remote
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmonettas committed Jan 29, 2024
1 parent 50c718c commit 04a4453
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
- Pasting in quick jump box doesn't fire autocomplete
- Quick jump should create and/or focus the tab
- Fix tree view freezes when a node contains too many childs
- Fix quick-jump on Clojure remote

## 3.9.1 (12-01-2024)

Expand Down
2 changes: 1 addition & 1 deletion src-dbg/flow_storm/debugger/repl/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
(try
(loop []
(let [repl-ok? (try
(= :watch-dog-ping (eval-code-str ":watch-dog-ping"))
(= :watch-dog-ping (eval-code-str ":watch-dog-ping" "user"))
(catch clojure.lang.ExceptionInfo ei
(let [{:keys [error/type] :as exd} (ex-data ei)]
(utils/log (format "[WATCHDOG] error executing ping. %s %s" type exd))
Expand Down
11 changes: 6 additions & 5 deletions src-dbg/flow_storm/debugger/state.clj
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@
:status/breakpoints])))

(s/def :repl/kind #{:nrepl})
(s/def :repl/type #{:shadow})
(s/def :repl/type #{:shadow :clojure})
(s/def :repl/port int?)
(s/def :repl.cljs/build-id keyword?)

(s/def :config/repl (s/nilable
(s/keys :req [:repl/kind
:repl/type
:repl/port
:repl.cljs/build-id])))
:repl/port]
:opt [:repl.cljs/build-id])))

(s/def :config/debugger-host string?)
(s/def :config/debugger-ws-port int?)
Expand Down Expand Up @@ -182,13 +182,14 @@
:debugger-config {:repl
(when port
(cond-> {:repl/kind :nrepl
:repl/type repl-type
:repl/type (or repl-type :clojure)
:repl/port port}
(#{:shadow} repl-type) (assoc :repl.cljs/build-id (:build-id config))))
:debugger-host (or debugger-host "localhost")
:debugger-ws-port (or ws-port 7722)
:runtime-host (or runtime-host "localhost")
:debug-mode? false}})
:debug-mode? false}
:bookmarks {}})

(def register-and-init-stage!

Expand Down
8 changes: 5 additions & 3 deletions src-inst/flow_storm/runtime/indexes/api.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(defn get-form [form-id]
(when forms-registry
(index-protos/get-form forms-registry form-id)))
(when forms-registry
(try
(index-protos/get-form forms-registry form-id)
(catch Exception _ nil))))

(defn all-threads []
(when flow-thread-registry
Expand Down Expand Up @@ -334,7 +336,7 @@
(let [{:keys [fn-call-stats-index]} (get-thread-indexes flow-id thread-id)]
(->> (index-protos/all-stats fn-call-stats-index)
(keep (fn [[fn-call cnt]]
(let [form (get-form (:form-id fn-call))]
(when-let [form (get-form (:form-id fn-call))]
(cond-> {:fn-ns (:fn-ns fn-call)
:fn-name (:fn-name fn-call)
:form-id (:form-id fn-call)
Expand Down

0 comments on commit 04a4453

Please sign in to comment.