First, let me say thanks for this awesome library! I'm working on an LSP backend for my own lil' language and was thrilled to find such a well designed and documented library in Clojure =D
I'm using a socket backend rather than stdin/stdout so that I can easily iterate on the LSP backend using the the usual clj-reload-type REPL workflow. I was confused as to why my println and telemere/log calls weren't having any effect from within, e.g.
(defmethod lsp4clj.server/receive-notification "exit"
[_ context params]
(println "LSP exit notification received")
nil)
Then I read the docs more closely and found this discarding-stdout
|
(defn thread-loop [buf-or-n f] |
|
(let [ch (async/chan buf-or-n)] |
|
(async/thread |
|
(discarding-stdout |
|
(loop [] |
|
(when-let [arg (async/<!! ch)] |
|
(f arg) |
|
(recur))))) |
|
ch)) |
Would you be open to making this optional somehow? Either an explicit option that's threaded through or, if that's too onerous, perhaps a dynamic var that can be rebound? I'm happy to knock out a PR if you have a preferred approach.
No worries if not too, I just figured I'd ask in case y'all think it'd be in scope. Thanks!
First, let me say thanks for this awesome library! I'm working on an LSP backend for my own lil' language and was thrilled to find such a well designed and documented library in Clojure =D
I'm using a socket backend rather than stdin/stdout so that I can easily iterate on the LSP backend using the the usual clj-reload-type REPL workflow. I was confused as to why my
printlnand telemere/log calls weren't having any effect from within, e.g.Then I read the docs more closely and found this
discarding-stdoutlsp4clj/src/lsp4clj/server.clj
Lines 117 to 125 in 4dd6d62
Would you be open to making this optional somehow? Either an explicit option that's threaded through or, if that's too onerous, perhaps a dynamic var that can be rebound? I'm happy to knock out a PR if you have a preferred approach.
No worries if not too, I just figured I'd ask in case y'all think it'd be in scope. Thanks!