5 ms·
> "More powerful editors like Cider and Cursive manage to do this with some very complex machinery that I could never duplicate. Instead, I decided to rethink t
by sdegutis 10y ago
> "More powerful editors like Cider and Cursive manage to do this with some very complex machinery that I could never duplicate. Instead, I decided to rethink the problem. Since Nightlight runs inside the same process as your project, code completion and other advanced features are trivial to implement."
How? What makes it easier to implement code completion when the IDE is running inside your project's JVM? Clojure is still a dynamic language, which means you'll never fully know what vars make actual sense in a given context. For example what vars in the current context make sense as arguments to the function you're about to call, when you have no idea what the type signature of that function is (which may even be a variable). Unless, do you mean very simple context-less code completion? That's what CIDER does, and presumably Cursive too, but they just do it by asking the process on the other end of the nREPL server for more details, and the plugins for these have access to the same JVM.
- gw 10y agoThe reason code completion is easier with this design is that I don't need to deal with any nREPL server; Nightlight can just go to the relevant namespace and ask for the available symbols. You are wrong that it is context-less code completion. In fact, I use the same library that CIDER does: https://github.com/alexander-yakushev/compliment https://github.com/alexander-yakushev/compliment I pass the entire top-level form to the library so it can make intelligent choices about what to complete. Here's how it works: https://github.com/alexander-yakushev/compliment/wiki/Examples https://github.com/alexander-yakushev/compliment/wiki/Exampl...
- sdegutis 10y agoNeat! Better than nothing! Still not as context-aware as IntelliJ does (sometimes), but it's hard to beat Jetbrains, especially as a sole developer. Plus Clojure doesn't exactly make this easy by being dynamic from the bottom up. Assuming you're Oakes, nice job, and I'm looking forward to trying out Nightlight and will probably enjoy it as much as Nightcode :) that said, why the choice of those buttons in the toolbars? Ctrl-S and Ctrl-Z and Ctrl-Y are pretty commonly known.
- tunaoftheland 10y agoJust wanted to repeat my sentiment in another thread, that I love this approach to problem solving. The outcome appears to be a tradeoff, but one that simplifies the hard part beautifully, leaving a simple(r) solution. I look forward to how this goes!
- junke 10y agoIt is easier to perform "X" inside the JVM instead of doing "X" in the JVM and providing a client/server protocol to do it from anywhere. The drawback is that you can't plug another client.
- sdegutis 10y agoWhich I guess means Nightlight should expect to see a lot of PRs and/or active forks.
- lemming 10y agoActually, Cursive doesn't do this, it analyses source for its completions.
- sdegutis 10y agoHmm, I knew it did that when the REPL wasn't on, because it gives very limited completion options compared to CIDER. Does Cursive even do this when you have access to a REPL, or when nREPL is running? That's the main reason I still prefer CIDER + Emacs, because it has much more useful completions, though still not as good as IntelliJ's completions for static Java code (only possible because Java is static).
- lemming 10y agoGenerally Cursive's completion should be (at least) as good as CIDER's, and if it isn't that's a bug I'd like an issue for. No-one has complained about it so far.