Fork me on GitHub
#calva
<
2023-06-29
>
Ben Lieberman18:06:38

It doesn't really bother me at all, but I do see duplicate documentation when I hover over any symbol from clojure.core or another library. For instance reg-event-db from re-frame shows me

re-frame.core/reg-event-db
[id handler]
[id interceptors handler]
Register the given event handler (function) for the given id. Optionally, provide an interceptors chain:

id is typically a namespaced keyword (but can be anything)
handler is a function: (db event) -> db
interceptors is a collection of interceptors. Will be flattened and nils removed.
Example Usage:

#!clj
(reg-event-db
  :token
  (fn [db event]
    (assoc db :some-key (get event 2)))  ;; return updated db
Or perhaps:

#!clj
(reg-event-db
  :namespaced/id           ;; <-- namespaced keywords are often used
  [one two three]          ;; <-- a seq of interceptors
  (fn [db [_ arg1 arg2]]   ;; <-- event vector is destructured
    (-> db
      (dissoc arg1)
      (update :key + arg2))))   ;; return updated db
/home/bhlieberman/.m2/repository/re-frame/re-frame/1.3.0/re-frame-1.3.0.jar:re_frame/core.cljc

re-frame.core/reg-event-db
[id handler]
[id interceptors handler]
Register the given event handler (function) for the given id. Optionally, provide an interceptors chain:

- `id` is typically a namespaced keyword  (but can be anything)
- `handler` is a function: (db event) -> db
- `interceptors` is a collection of interceptors. Will be flattened and nils removed.
Example Usage:

  #!clj
  (reg-event-db
    :token
    (fn [db event]
      (assoc db :some-key (get event 2)))  ;; return updated db
Or perhaps:

  #!clj
  (reg-event-db
    :namespaced/id           ;; <-- namespaced keywords are often used
    [one two three]          ;; <-- a seq of interceptors
    (fn [db [_ arg1 arg2]]   ;; <-- event vector is destructured
      (-> db
        (dissoc arg1)
        (update :key + arg2))))   ;; return updated db
Didn't see an open issue on perusal of the Github so figured I'd point this out.

pez20:06:35

You are welcome to file an issue about it. I’ve tried to fix it, but it is a bit involved so I need some larger chunk of time to focus on it.

zimablue18:06:30

why does calva use it's own paredit implementation?

isak19:06:54

Which implementation do you think calva should consider?

zimablue19:06:38

I'm not making a proposal I was just asking to understand, borkdude/rewrite-clj?

isak19:06:52

It is probably because Calva is made in TypeScript (at least that part of it)

zimablue19:06:28

I'm afk but I thought that part was cljs

isak19:06:13

Interesting, I didn't know that was there

zimablue19:06:00

I was about to employ rewrite-clj for something and thought I'd check what calva does

👍 2
zimablue19:06:38

But I don't know whether it's there because of history of because there's some very meaningful differences without a lot of of source reading

pez20:06:34

The reason we have a copy of rewrite-cljs in Calva is because we have a copy of cljfmt that needs this version of rewrite-cljs. So I have hacked the names a bit to avoid dependency clashes with the Clojar version of cljfmt that we also use. paredit.cljs just happens to be there and is not used.

👌 2
👍 2
pez20:06:45

We have rolled our own Paredit because we have many uses for a structured document model and it is important that the same idea of the structure is shared across the different features. It also helps keep the number of parses of each document down when all features can share this.