Skip to content

Commit

Permalink
Add multimethod dispatch-val to stack pane
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmonettas committed Sep 7, 2023
1 parent 69872d7 commit 850e16c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### New Features

- Add multimethod dispatch-val to stack pane

### Changes

### Bugs fixed
Expand Down
7 changes: 5 additions & 2 deletions src-dbg/flow_storm/debugger/ui/flows/code.clj
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@
(add-all bindings)))

(defn- create-stack-pane [flow-id thread-id]
(let [cell-factory (fn [list-cell {:keys [fn-ns fn-name]}]
(.setGraphic list-cell (label (str fn-ns "/" fn-name) "link-lbl")))
(let [cell-factory (fn [list-cell {:keys [fn-ns fn-name form-def-kind dispatch-val]}]
(.setGraphic list-cell (label (if (= :defmethod form-def-kind)
(str fn-ns "/" fn-name " " dispatch-val)
(str fn-ns "/" fn-name))
"link-lbl")))
item-click (fn [mev selected-items _]
(let [{:keys [fn-call-idx]} (first selected-items)]
(when (= MouseButton/PRIMARY (.getButton mev))
Expand Down
9 changes: 7 additions & 2 deletions src-inst/flow_storm/runtime/indexes/api.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,13 @@
(let [{:keys [timeline-index]} (get-thread-indexes flow-id thread-id)
{:keys [fn-call-idx-path]} (index-protos/tree-frame-data timeline-index fn-call-idx {:include-path? true})]
(reduce (fn [stack fidx]
(conj stack (select-keys (index-protos/tree-frame-data timeline-index fidx {})
[:fn-ns :fn-name :fn-call-idx])))
(let [{:keys [fn-name fn-ns fn-call-idx form-id]} (index-protos/tree-frame-data timeline-index fidx {})
{:keys [form/def-kind multimethod/dispatch-val]} (get-form form-id)]
(conj stack (cond-> {:fn-name fn-name
:fn-ns fn-ns
:fn-call-idx fn-call-idx
:form-def-kind def-kind}
(= def-kind :defmethod) (assoc :dispatch-val dispatch-val)))))
[]
fn-call-idx-path)))

Expand Down

0 comments on commit 850e16c

Please sign in to comment.