@pesterhazy did you get some hammock time to think about completion and friends?
my rough plan was to implement the whole thing for clojurescript, then abstract out the commonalities
@pesterhazy what are you current commands set? Autocomplete? Doc?
those two, plus interrupt
still a very small interface. It needs refactoring, it's totally hacky
Well interrupt in js...
haha, true
how do people do autocomplete in cljs?
look at the global js mangled names?
if I type freak-sh<TAB>
, look at js/window.current.ns.freak_sh*
?
@pesterhazy I imagine that you'd look at the compiler env. CLJS doesn't have the same runtime capabilities CLJ has so you can't just find-ns
and iterate the vars
right, hmm...
https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/analyzer/api.cljc
should have pretty much everything you'd need
I'm wondering what the limits of the simple-minded approach I mentioned would be
@thheller, what you're saying is that I'll need to access the compiler state, which works very differently in JVM cljs, lumo and planck
Well I think it's best to consider JVM cljs and selfhosted cljs as two similar but distinct targets
RE cljs completion, iirc there’s a “fork” of compliment that works for cljs in the replique repo https://github.com/EwenG/replique/tree/master/src/replique/compliment
Don’t remember why it never made it upstream though
FWIW Lumo already provides a hook for you to get completions
https://github.com/anmonteiro/lumo/blob/master/src/cljs/snapshot/lumo/repl.cljs#L1249
anmonteiro: ah nice!
@thheller Do you think that tools like unravel should be lsp clients for their completion support?
@jfntn I have been thinking of creating one using Tern (or even just porting)
there was an issue in compliment
for that
but unfortunately I haven't had time yet
Ah that could be useful, cider’s completion works for cljs but I’d love to have js completion in there as well
yeah, in particular object completion now it is done in lumo by piggiebacking on the node.js repl
@dominicm yes, probably. but lsp is just another protocol so as long as upgrading is supported you can use whatever really
@thheller as unrepl has no support for multiplexing, that means multiple connections though correct?
I would think so yes.
@cgrand I've never fully grasped what a constrained environment looks like?
An env in which you can't create a second connection. Far from being the norm. You can imagine starting the process using exec and just talking to it over good old stdin stdout. No socket involved.
Or in a browser repl where it's the browser connecting to the server (even if there are other solutions)
stdin/stdout is a good one. inf-clojure would love that one.