Fork me on GitHub
#unrepl
<
2017-05-03
>
cgrand10:05:21

@pesterhazy did you get some hammock time to think about completion and friends?

pesterhazy15:05:05

my rough plan was to implement the whole thing for clojurescript, then abstract out the commonalities

cgrand15:05:58

@pesterhazy what are you current commands set? Autocomplete? Doc?

pesterhazy16:05:54

those two, plus interrupt

pesterhazy16:05:24

still a very small interface. It needs refactoring, it's totally hacky

cgrand16:05:39

Well interrupt in js...

pesterhazy16:05:16

how do people do autocomplete in cljs?

pesterhazy16:05:30

look at the global js mangled names?

pesterhazy16:05:44

if I type freak-sh<TAB>, look at js/window.current.ns.freak_sh*?

thheller16:05:20

@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

pesterhazy16:05:06

right, hmm...

thheller16:05:47

should have pretty much everything you'd need

pesterhazy16:05:05

I'm wondering what the limits of the simple-minded approach I mentioned would be

pesterhazy17:05:59

@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

cgrand17:05:34

Well I think it's best to consider JVM cljs and selfhosted cljs as two similar but distinct targets

jfntn17:05:29

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

jfntn17:05:50

Don’t remember why it never made it upstream though

anmonteiro17:05:37

FWIW Lumo already provides a hook for you to get completions

pesterhazy12:05:42

anmonteiro: ah nice!

dominicm17:05:18

@thheller Do you think that tools like unravel should be lsp clients for their completion support?

richiardiandrea18:05:49

@jfntn I have been thinking of creating one using Tern (or even just porting)

richiardiandrea18:05:18

there was an issue in compliment for that

richiardiandrea18:05:32

but unfortunately I haven't had time yet

jfntn18:05:35

Ah that could be useful, cider’s completion works for cljs but I’d love to have js completion in there as well

richiardiandrea18:05:35

yeah, in particular object completion now it is done in lumo by piggiebacking on the node.js repl

thheller19:05:08

@dominicm yes, probably. but lsp is just another protocol so as long as upgrading is supported you can use whatever really

dominicm19:05:35

@thheller as unrepl has no support for multiplexing, that means multiple connections though correct?

cgrand19:05:52

@dominicm or upgrade to a multiplexer first (if you are in a constrained environment)

dominicm19:05:44

@U3E46Q1DG I've never fully grasped what a constrained environment looks like?

cgrand19:05:09

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.

cgrand19:05:09

Or in a browser repl where it's the browser connecting to the server (even if there are other solutions)

dominicm19:05:34

stdin/stdout is a good one. inf-clojure would love that one.

thheller19:05:20

I would think so yes.

cgrand19:05:52

@dominicm or upgrade to a multiplexer first (if you are in a constrained environment)