gregsh / Clojure-Kit

Clojure/ClojureScript plugin for IntelliJ-based IDEs
Other
248 stars 21 forks source link

no Leiningen option when importing existing project and no repl under run / tools #3

Closed rickr-pax closed 7 years ago

rickr-pax commented 8 years ago

Ultimate ver 2016.2.5. Had previously installed Cursive plugin then uninstalled it before installing Clojure-kit also uninstalled then re-installed this plugin and still no run / debug / repl ability.

Nice work on code navigation portion!

Thanks, Rick

gregsh commented 8 years ago

lein (or boot) import is not required, just add project files in any fashion so that required project.clj's show up in project view and that's it. If you want to re-sync dependencies manually open project.clj and look for fading in/out buttons in the upper-right corner.

To repl just hit ctrl-enter or search for REPL action via go-to-action (ctrl-shift-A). It shall start new repl or connect to a running one automatically.

There's currently no debugger.

rickr-pax commented 8 years ago

Thank you, I am able to fire up the repl but executing anything directly in it, e.g. '(+ 1 2)' doesn't work. Using the editor and hitting apple-enter works, thought, so i guess that's a reasonable work around for now.

There are some weird things in the editor though, e.g. using the delete key wipes out an entire region of code!?! ; maybe apple-del should do this but not delete

And in general looking forward to tighter lein / repl / configuration integration. For example it would great to build a project on the command line such as 'lein new luminus guestbook +h2' and then launch intellij, open the directory and hit 'Run' and have a working repl and the app running.

Keep up the great work and as for items most important to me, i'd say get everything else working first and then look to the debugger afterwards. lein integration and some kind of working repl while the app is running would be intensely useful (see luminus example above).

Thanks!

gregsh commented 8 years ago

I suggest trying the latest dev build here that shall be released shortly. The structural editing issues are fixed there.

As for REPL integration, here's what I did:

  1. ran lein new luminus guestbook +h2 in Terminal
  2. added guestbook folder so it appeared in Project view (depends on IDE)
  3. opened project.clj and hit command-Enter on an empty line
  4. in the REPL that appeared I ran (guestbook.core/-main)
user=> 
user=> (guestbook.core/-main)
2016-11-20 22:14:07,025 [nREPL-worker-0] INFO  guestbook.env - 
-=[guestbook started successfully using the development profile]=- 
2016-11-20 22:14:07,112 [nREPL-worker-0] INFO  luminus.http-server - starting HTTP server on port 3000 
2016-11-20 22:14:07,146 [nREPL-worker-0] INFO  org.xnio - XNIO version 3.3.6.Final 
2016-11-20 22:14:07,264 [nREPL-worker-0] INFO  org.projectodd.wunderboss.web.Web - Registered web context / 
2016-11-20 22:14:07,265 [nREPL-worker-0] INFO  luminus.repl-server - starting nREPL server on port 7000 
nil
read config from resource: "config.edn"
...

It seems the missing thing is some quick way to run lein / boot targets via some chooser.

UPD a quicker way without running the main class manually:

  1. add parallel do plugin to project.clj: :user {:plugins [[lein-pdo "0.1.1"]]}
  2. run lein pdo run, repl in Terminal
  3. command-Enter on any form in IDE to show REPL and run the form

UPD2 Just realised there's a ClojureScript REPL too and there's no way to connect to it from IDE.

rickr-pax commented 8 years ago

Fantastic, these instructions were very handy..might I suggest adding them to the readme as a "quick start" example.

Also, it took me a while to understand the repl command line behavior. Hitting "enter" (OS X 10.11.5) doesn't execute the expression until you hit command-enter, exactly like what occurs within the editor.

The result of the eval is then placed "above" the user=> line which i initially thought rather odd (my brain was expecting a command line like output where the output follows the command), but then I realized that there are 2 windows there (the upper one being scrollable). I think some simple indicator such as a faint line or something would have helped reduce the confusion.

Thanks again!

gregsh commented 7 years ago

8d0134bdd adds Tools | Clojure submenu de217cbd4 adds Connect to REPL action I believe, that completes this case.

Feel free to try out the [dev] build while it is not published to plugin repo and comment.

rickr-pax commented 7 years ago

Yes, all covered now thank you.