lsp4clj icon indicating copy to clipboard operation
lsp4clj copied to clipboard

Make discarding-stdout optional?

Open lynaghk opened this issue 5 months ago • 1 comments
trafficstars

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 https://github.com/clojure-lsp/lsp4clj/blob/4dd6d62dbbe1aeb906b7f88a9a06bf85d4ce19ba/src/lsp4clj/server.clj#L117-L125

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!

lynaghk avatar Jun 05 '25 19:06 lynaghk