clojure-lsp / clojure-lsp/lsp4clj
Make discarding-stdout optional?
- Dominant language
- Clojure
- Stars
- 67
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
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](https://github.com/tonsky/clj-reload)-type REPL workflow. I was confused as to why my `println` and [telemere](https://github.com/taoensso/telemere)/log calls weren't having any effect from within, e.g.
```clojure
(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!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with src/lsp4clj/server.clj around lines 117-125 and the lsp4clj.server/receive-notification entry point, then trace how the socket backend reaches the stdout-discarding behavior. Done means callers can choose whether stdout is discarded, and the socket workflow can emit println and telemere/log output when discarding is disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- clojure
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100