Skip to content

Commit 8af1d52

Browse files
authored
Merge pull request #33 from clojure-lsp/define-pprint-for-requests
Define pprint for PendingRequest
2 parents 644b3f0 + 531e4da commit 8af1d52

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
.nrepl-port
55
**/*/.lsp/.cache
66
**/*/.clj-kondo/.cache
7+
.lsp/.cache
8+
.clj-kondo/.cache
79
/out
810
target/
911
/.DS_Store

src/lsp4clj/server.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@
7272

7373
;; Avoid error: java.lang.IllegalArgumentException: Multiple methods in multimethod 'simple-dispatch' match dispatch value: class lsp4clj.server.PendingRequest -> interface clojure.lang.IPersistentMap and interface clojure.lang.IDeref, and neither is preferred
7474
;; Only when CIDER is running? See https://github.com/thi-ng/color/issues/10
75-
(prefer-method pprint/simple-dispatch clojure.lang.IDeref clojure.lang.IPersistentMap)
75+
;; Also see https://github.com/babashka/process/commit/e46a5f3e42321b3ecfda960b7b248a888b44aa3b
76+
(defmethod pprint/simple-dispatch PendingRequest [req]
77+
(pprint/pprint (select-keys req [:id :method :started])))
7678

7779
(defn pending-request
7880
"Returns an object representing a pending JSON-RPC request to a remote

0 commit comments

Comments
 (0)