10 ms·
Cursive Clojure: A Clojure IntelliJ plugin
- lemming 13y agoDeveloper here - I'm happy to answer any questions folk might have!
- Terretta 13y agoNo questions yet but we'll be trying this. Thrilled to see more tooling for this language.
- lemming 13y agoGreat! Hope you enjoy it, I'd love to know what you think and what you'd like to see in it.
- dljsjr 13y agoHow does this compare to the official JetBrains plugin, La Clojure?
- lemming 13y agoCursive is based off a fork of La Clojure from a long time ago. Since then I've rewritten 80% of the code in Clojure and added a lot of new functionality and fixed a lot of bugs. There's lots of new stuff in there, but the main highlights are Paredit-style structural editing and good nREPL integration (for local and remote REPLs). Jan Thomä also kindly let me bundle the leiningen plugin so that's provided out of the box and I'll be making a lot of improvements to that over the next couple of weeks. All the beta testers have said it's a great improvement over La Clojure. Unfortunately La Clojure has never been a priority for JetBrains, which is what let me to start work on this a while back. I'm planning to release this as a commercial PyCharm-style IDE, at a similar price point. I've done this in consultation with JetBrains, in case anyone's concerned about that. Edit: some clarification.
- systems 13y agodo you plan to go commercial, imminently i.e. as soon as you go out of beta and settle things down ... or is this just a future possibility?
- lemming 13y agoPretty much right away after the beta program, although I'm not sure how long that will be. Probably late this year sometime, but it depends on the problems people find.
- dljsjr 13y agoAwesome. I've only been playing with Clojure for a few months but IntelliJ IDEA has been my go-to IDE for a long time now so all of that time has been spent with La Clojure + Leiningen plugin and I've always felt that it was a little clunky (and that the Leiningen plugin was a bit of a 2nd class citizen). Hopefully a little TLC and a cohesive vision can yield something that's much nicer to work with. Looking forward to seeing where this project ends up.
- sesm 13y agoAs far as I understand, Cursive will be available both as a plugin and as a standalone IDE, right? What will be the added value of standalone IDE? PyCharm is a subset of IDEA Ultimate + Python plugin, will it be the case with Cursive? In other words, does it make sense to buy Cursive IDE for users who already have IDEA Ultimate?
- lemming 13y agoThe standalone IDE will be useful for people getting started with Clojure, since it'll provide a more integrated experience - we bundle lein so that Windows developers don't need to download and install it to get going, for example (although this is currently not exposed to the user, coming soon). Clojure is great but the getting started experience is still not great for total newbies. I hope to provide a great environment that'll be basically a one-click download to get started. It'll be similar to PyCharm in that the standalone IDE will be basically a cut-down Community edition plus the plugin, right, although it can be customised more heavily for Clojure if required. The licensing will be the same for the plugin and the IDE (i.e. your licence will work for both), so if you already own IntelliJ Ultimate it would make sense to stay with that. Unfortunately I don't have the luxury of offering the plugin free to IntelliJ Ultimate users as JetBrains can do with PyCharm.
- hendekagon 13y agoJust installed it...very happy to see structural editing! Aaand immediately I want more features! Can we have a feature to allow any function (that follows some specification) to be bound to a key so that it can be applied to the selected expression ? This would allow for functional editing or even editing based on core.logic and core.match. Also can we have function application graphs (which functions use which other functions) ? BTW I will gladly pay/donate for/to your work - nice one!
- lemming 13y agoHmm, the functional editing idea is interesting - can you drop me an email at the address on the webpage to discuss? I'd like to know what you have in mind for that. Function application graphs would be great too, and could be built off the resolution functionality.
- olenhad 13y agoDo you have a rainbow-parens mode? I've become overdependent on those in emacs.
- lemming 13y agoSure do - Settings->Clojure->Rainbow Parens. You can't customise the colours right now, but that's coming in the next drop.
- hansgru 13y agoThere are many (important IMO) feature requests for LaClojure in the Issue tracker. Any plans to implement at least some of those?
- lemming 13y agoA lot of these are fixed in Cursive - anything in particular you're after?
- hansgru 13y ago#CLJ-183, #CLJ-188, #CLJ-186, #CLJ-178, #CLJ-165, #CLJ-129, #CLJ-77 to mention just a few.
- lemming 13y agoCLJ-183, CLJ-186, and CLJ-77 are fixed. I'll check CLJ-165. CLJ-129 is coming very soon. ClojureScript support is definitely on the list but will take a while - we do recognise .cljs files, at least.
- aerlinger 13y agoAny chance you will roll this out to other JetBrains IDEs (RubyMine, Webstorm, PyCharm, etc...)?
- lemming 13y agoYes, this is not something that I've investigated but it's definitely doable if there's demand.
- DigitalJack 13y agoWhat license will this be released under?
- lemming 13y agoThis will be commercial, similar to PyCharm, RubyMine and the other JetBrains IDEs. I'm considering a slightly restricted free edition that can't be used for commercial work, but I haven't worked out the details yet. It almost certainly won't be fully open source, but I'm considering having a small closed source core and then the majority of the Clojure implementation being open source and extensible. This will need some thought and probably won't happen right away though. In the short term it'll be closed source commercial.
- andrewcooke 13y agohow does that work if it's a fork of la clojure? are you paying intellij? did they licence their code under a very open licence?
- lemming 13y agoYes, they released their code under the Apache license. I checked with them before deciding to go ahead with this and they didn't have a problem with the idea.
- DigitalJack 13y agoYeah, I would definitely appreciate a free edition to try out. It would have to be pretty impressive to switch me away from emacs (and vim), and I'd have to try it first to know.
- Kototama 13y agoHow is "renaming of symbols" done? Did you write your own Clojure parser?
- lemming 13y agoRight, this is one of the great things about the IntelliJ platform products - the IDE actually parses the program and creates an AST. This allows support for all the magic like refactorings and so forth, including rename. Basically I implement symbol resolution and rename mostly just magically works. Unfortunately due to macros in Clojure symbol resolution is far from trivial.
- pron 13y agoHow do I choose the lein profile? How can I add a lein plugin task (like midge) to?
- lemming 13y agoThere's still some lein functionality I need to add. Currently the best way to add a non-standard task like lein midje is to create a run config (Run->Edit Configurations..., hit + and select Leiningen). I'm going to be improving this soon - I assume you'd want to see those in the Lein toolwindow? Drop me an email if that doesn't do what you need it to.
- pron 13y ago> I assume you'd want to see those in the Lein toolwindow? Exactly. Good plugin BTW. I like the jump to Java code (I work on a mixed Java/Clojure project), and was very happy to find out that renaming a Java method fixed the Clojure calls, too. And find usages works across languages! Keep up the good work! EDIT: One problem I've found: If a function is defined not with defn but using a macro that expands to defn, then the symbol is not resolved. EDIT 2: Just checked: refactoring and find usages works with Kotlin code, too (in a mixed Clojure/Java/Kotlin project).
- cantelo 13y agoJust having a look at Cursive now, nice work! How do I enable and use the symbolic debugger? TIA
- lemming 13y agoYou should be able to run any script in Debug mode (Run->Debug instead of Run->Run) and you can also debug your REPL session, although this is very clunky right now. I'll get some documentation up and provide a link here.
- lemming 13y agoI added some instructions for debugging REPL sessions to http://cursiveclojure.com/quickstart.html http://cursiveclojure.com/quickstart.html - it's clunky right now but I'll be fixing that soon.
- treerex 13y agoI'd be interested in seeing some screen shots to get a feel for its integration and new features.
- lemming 13y agoI'll be looking to get those up ASAP - the cat got out of the bag a little sooner than I expected!
- warcher 13y agoDo you have a mailing list or something so I can get development news? Cause I'm interested in hearing how this develops, the website is a little sparse still, and I absolutely will not remember to come back in a month, haha.
- lemming 13y agoI'm definitely planning to get a mailing list set up, I was caught slightly on the hop by the unexpected public release! I'll set something up ASAP.
- kul_ 13y agocan it be integrated with vim?
- AndreasFrom 13y agoI often hear good things about IdeaVim. I don't think that's want you meant, but I just wanted to throw it in there.
- vutekst 13y agoI use IdeaVim every day for java work. It's okay, but it's a pretty shallow emulation, and I frequently miss things from real vim.
- lemming 13y agoIf you're interested in whether the Cursive functionality can be integrated into Vim, the answer is no - it relies on a lot of the functionality of the IntelliJ platform. As AndreasFrom mentioned, the IdeaVim bindings are meant to be really good, but I don't use them myself.
- systems 13y agoI installed this, but I cant figure out how to create a new clojure project? why isn't there a clojure option in the new project menu, like, groovy for example?
- lemming 13y agoSorry, I need to get a quick start page up. Just create a new Java project, and it'll prompt you at the end to add Clojure to it.
- lemming 13y agoI added a (very) quick start guide here: http://cursiveclojure.com/quickstart.html http://cursiveclojure.com/quickstart.html. I'll get something prettier/better up ASAP.
- timothyklim 13y agough, if someone will make plugin for haskell — it will be amazing. I'm so glad for clojure community.
- lemming 13y agoBTW someone mentioned below the lack of a mailing list - if anyone would like to be updated about new releases drop me a line on cursive@cursiveclojure.com and I'll keep you up to date.
- edem 13y agoWhy not Eclipse? 65% of java developers use it. Only 9% uses IntelliJ. Just asking.
- lemming 13y agoFor a couple of reasons. One is that there's already a great Clojure environment for Eclipse - Counterclockwise. Secondly, I think that IntelliJ provides a better platform for building something like this - it's just a better IDE all round in my opinion, and it's a great infrastructure to build on. I suspect that you'd probably find that the percentage of Java devs using IntelliJ has gone up a lot in recent years too, their market share and mindshare has increased massively recently. I'm not aware of any stats though (and I'm not sure how accurate they would be if there were). Google recently switched from Eclipse to IntelliJ for the official Android development environment, for whatever that's worth.
- mjt0229 13y agoThis looks great at first glance. Thanks for all your hard work!
- mb02134 13y agoWill Cursive be providing a strict paredit mode?
- lemming 13y agoYes, that's already about 80% there. There are some of the paredit commands missing but it's very usable right now. The most obvious omissions are open-round-and-newline, wrap-round and kill-word. Most other commands are there, and it's strict in the sense of preserving braces with backspace/delete.