Skip to content

leifericf/joyride

 
 

Repository files navigation

Joyride VS Code with Clojure!

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).

WIP

You are entering a construction yard. Your feedback is highly welcome!

Quickstart

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.

There's a REPL server

While developing Joyride scripts you should of course do it leveraging Interactive Programming (see this video demonstrating it). Here are the steps:

  1. Issue the command Joyride: Start nREPL. This will start Joyride's nREPL server.
  2. Connect your Clojure editor (we suggest Calva for super biased reasons.)
  3. Open a script (presumeably in the .joyride/scripts folder)
  4. Hack away!

Support and feedback

You'll find us in the #joyride channel on the Clojurians Slack

News

Twitter

Follow the #vsjoyride hashtag on Twitter!

Releases

No releases published

Packages

No packages published

Languages

  • Clojure 99.0%
  • JavaScript 1.0%