trptcolin / reply

REPL-y: A fitter, happier, more productive REPL for Clojure.
Eclipse Public License 1.0
337 stars 44 forks source link

[Suggestion] Replace core.complete with compliment #150

Open bbatsov opened 10 years ago

bbatsov commented 10 years ago

core.complete is pretty much abandon-ware these days. I'd suggest replacing it the more feature-rich, documented and tested compliment. Not to mention it's actively maintained.

As their APIs are pretty similar I expect that swapping core.complete with compliment should be relatively easy.

trptcolin commented 10 years ago

Can you give some more specific benefits? Documentation / testing are nice, and so is active maintenance, but switching dependencies is going to require more specific reasons. How exactly will things be better for me as a REPL user?

bbatsov commented 10 years ago

compliment supports more completion sources - like interned keywords, special forms, etc. It also offers context sensitive completion (https://github.com/alexander-yakushev/compliment/wiki/Context) and best of all (for REPL users) - fuzzy completion (https://github.com/alexander-yakushev/compliment/wiki/Examples).

I understand the implications in switching deps, but I think it will be well worth it.

trptcolin commented 10 years ago

The context-sensitive and fuzzy stuff both sound like significant work to implement. Not that they're bad ideas, but currently we only append characters (no backtracking), so the change in jline interaction would be significant.

Actually, it looks like the context-sensitive parts depend on having entire expressions. I don't see how this can work for a command-line REPL since you haven't typed in the closing part of the expression.

Non-static member completion and keywords do seem like obvious improvements.

bbatsov commented 10 years ago

Actually, it looks like the context-sensitive parts depend on having entire expressions. I don't see how this can work for a command-line REPL since you haven't typed in the closing part of the expression.

This slipped my mind. I maintain Emacs's Clojure REPL, but there I have auto-closing of delimiters and the context can be used fairly easy. Not sure how easy some auto-pairing can be done for REPL-y, but I guess it'll be fairly hard.

Ultimately, it's your call. I'm reasonably sure compliment is the way to go and I'd love to see more projects rely on it. Advanced features aside, the basic integration will still yield useful improvements for REPL-y's users (at least IMHO).

trptcolin commented 10 years ago

Yes, auto-pairing like that isn't going to happen without moving to a full text editor in the console. JLine handles a line at a time, so matching delimiters isn't really feasible.

Leaving this open for anyone who wants to implement the basics and see how it goes.

bbatsov commented 10 years ago

OK, I'll take a stab at this and we'll see how it'll go.