nrepl/piggieback

Implement JS completion mechanism

arichiardi opened this issue · 2 comments

Hi all!

I would like to slowly start tinkeiring with JS completions for CIDER. This is an initial issue for start thinking about it, possibly refactoring what is there maybe according to ideas in #73

My naive idea would be to intercept the complete op and somehow understand if a cljs REPL is attached, in which case evaluate some JavaScript using piggieback in order to get completions to the currently required JavaScript modules (lumo does it this way).

However, this could be the first real use case for the new op + metadata @thheller was talking about, where the client sends information in order to choose the environment to evaluate the expression in. Complete could have an additional :target and then a higher middleware layer decides how to move forward.

Just an idea, happy to discuss more and start hacking 😄

So, basically this ticket is about the adding the metadata or what?

I don't think it makes sense to add a complete op in piggieback, as cider-nrepl already does this and dispatches based on the repl type.

I was under the impression we don't have consensus when it comes to pausing/resuming cljs REPLs and directly teaching nREPL about different evaluation modes (clj and cljs).

I agree that adding individual ops to piggieback doesn't make sense.

The one op that does make sense is the passthrough eval op of some kind.

Which would make it easier to add adhoc functionality to the ClojureScript REPL session.