[NREPL-64] Add current ns to describe session's response Created: 24/Aug/14 Updated: 27/Aug/14
|Reporter:||Bozhidar Batsov||Assignee:||Chas Emerick|
In CIDER the REPL buffer gets created on receiving a describe-session response from the nREPL session that will back the REPL buffer. There's a problem with determining the default ns for the REPL buffer as many people use nREPL servers started with lein (lein repl :headless) and expect the `:init-ns` option for their project to the honored, but there's no easy way for clients to know what the default namespace is. It'd be great if this information was returned by `describe-session`.
Perhaps clients should be able to create a session with a particular default namespace to avoid the need for code like https://github.com/technomancy/leiningen/blob/554861505c23763d6583fe3b1f236a08ad02a4ca/src/leiningen/repl.clj#L103. I noticed that current the default ns is hardcoded as `user`.
|Comment by Chas Emerick [ 25/Aug/14 8:59 PM ]|
As you say, the default nREPL namespace is always user, so that's easy to know.
Leiningen's :init-ns support is implemented sanely AFAICT, given what it's aiming to accomplish. There's lots of vars in the session that one might want to customize on a per-project basis, and that tools might want to know the value of. I don't see any reason to special-case *ns*. This is one of the rare times where I'd say that a tool's best option is to use eval.
|Comment by Bozhidar Batsov [ 27/Aug/14 10:09 AM ]|
While I'd normally agree, the problem is that I'd have to rework cider's init in a bit awkward manner:
While I can certainly do this, chaining callbacks just to get some bootstrap info seems suboptimal to me. Ideally all bootstrap information
I can't imagine any other var value that a similar tool would like to know while bootstrapping. Obviously once you're up and running using eval is the natural solution.