Modify your editor by executing ClojureScript code in your REPL and/or run scripts via keyboard shortcuts you choose. The Visual Studio Code API is at your command!
Joyride is Powered by SCI (Small Clojure Interpreter).
You are entering a construction yard. Your feedback is highly welcome!
Create a script in your workspace under .joyride/scripts
, e.g. example.cljs
:
(ns example
(:require ["fs" :as fs]
["path" :as path]
["vscode" :as vscode]
[clojure.string :as str]))
(defn info [& xs]
(vscode/window.showInformationMessage (str/join " " xs)))
(info "The root path of this workspace:" vscode/workspace.rootPath)
(fs/writeFileSync (path/resolve vscode/workspace.rootPath "test.txt") "written!")
This script gives one information message and writes to a file test.txt
in
your workspace.
Then in your keyboard shortcuts, add:
{
"key": "cmd+1",
"command": "joyride.runWorkspaceScript",
"args": "example.cljs"
}
Now you can run the example.cljs
script by just hitting Cmd+1!
See doc/configuration.md for full configuration options
Check out this video for a demonstration.
While developing Joyride scripts you should of course do it leveraging Interactive Programming (see this video demonstrating it). Here are the steps:
- Issue the command Joyride: Start nREPL. This will start Joyride's nREPL server.
- Connect your Clojure editor (we suggest Calva for super biased reasons.)
- Open a script (presumeably in the
.joyride/scripts
folder) - Hack away!
You'll find us in the #joyride
channel on the Clojurians Slack
Follow the #vsjoyride hashtag on Twitter!