Closed Deraen closed 5 years ago
The need for arguments in #326 points to a simple string option instead: "(foo.bar/baz "quux")"
. An empty string could be used to disable.
What about calling require
? Currently ns and fn name are separate to it is easy to call require
for the ns part.
I guess the value could be something like (do (require 'cljs.repl.nashorn) (resolve 'cljs.repl.nashorn/repl-env))
, does this make sense?
https://github.com/tpope/vim-fireplace/blob/master/plugin/fireplace.vim#L323-L325 But I'm not sure if that is correct.
Yeah I guess the do
variant is acceptable.
Okay, this is now reworked to use single string option.
I missed the resolve
nastiness. Could we do something like let ns = matchstr(var, '^(\zs[^/]\+\ze/')
or is that getting too convoluted?
Sorry about forgetting this.
I'm not sure if we should just allow qualified symbols and then parse the namespace from that automatically, or if providing custom code (e.g. require and resolve, or something else) is required in some cases. Simplest solution might be to even only take the namespace as option, because the name is repl-env
in all cases I know.
One benefit from taking Clojure code as the option value is, that it allows repl env options, like :port 1234
.
I know this is a long shot, but is there any way we can figure out the port automatically? Ages ago I made rails.vim automatically find the port of the web server by querying lsof
or netstat
with the server pid, and hoo boy that was a godsend when dealing with multiple apps.
I find it inconvenient that if I accidentally hit
cpp
in.cljs
files, or when using omnicomplete, when I don't have browser repl connection set up, Vim stops for few seconds opening up Nashorn REPL, so I'd like to have option to disable default Nashorn REPL creation.Cljs also nowadays supports many other REPL environments, like Node.js, Graal.JS and Rhino so I think it would be good idea to provide option to control this.