Cursive (IntelliJ)
Intellij has its own Gradle support, so that will cover getting things imported and the ability to run ad-hoc Gradle tasks.
As of 2022-08-02, Cursive doesn’t have direct Gradle support, but it is generally compatible once the project is imported. |
Once you’re connected to the REPL, see Cursive’s documentation for usage information.
Start your nREPL Server
Kick off the REPL task from the shell.
$ ./gradlew clojureRepl
This will create the standard .nrepl-port
file in your project root once the nREPL server is running.
Connect to Remote REPL
Cursive refers to this as a "remote" REPL, just meaning that it didn’t start the REPL for you.
-
In Run → Edit Configurations
-
Click the + to make a new configuration, choose Clojure REPL → Remote REPL
-
Fill in the Name, as desired (we’ll use
Gradle REPL
) -
Choose nREPL as the connection type
-
Choose Use port from nREPL file
-
Choose your project’s
*.dev
module as the Context Module -
Specify custom port file as
../../.nrepl-port
(presuming you use the standardsrc/dev/clojure
project layout)
-
-
Click OK
Now start your Gradle REPL
run configuration.
Success! Now you can continue using Cursive with your active REPL.