Making VS Code Hackable since 2022Modify your editor while it is running by executing ClojureScript code via the Joyride REPL and/or run scripts via keyboard shortcuts you choose. The Visual Studio Code API, as well as the APIs of its extensions, are at your command! Joyride makes VS Code scriptable in a very similar way to how how Emacs users can hack their editor. Complete with Interactive Programming. The video in much better quality on Youtube (CalvaTV) Joyride is Powered by SCI (Small Clojure Interpreter). You can use both JavaScript and ClojureScript with Joyride. You will only get to enjoy Interactive Programming using ClojureScript, because JavaScript does not support it. Also the JavaScript support in Joyride is new and not yet fully at par with the ClojureScript support. See doc/api.md for documentation about the Joyride API. Your feedback is highly welcome! User and Workspace scriptsJoyride supports User and Workspace scripts:
You can run or open the scripts using commands provided (search the command palette for Joyride):
Note, about Clojure namespaces: Used with ClojureScript, Joyride effectively has a classpath that is Quickest Start - Start Here - Install JoyrideInstalling Joyride will also install, and run, a sample Joyride installs two "regular” User scripts:
You can run these scripts with the commands mentioned above. Also: In the Joyride: Run Workspace Script menu, there is a command for downloading and installing some default/example workspace scripts. Quick Start - Ask CoPilot to do some Joyride hackingNB: Joyride gives you and CoPilot full access to the VS Code API and execution environment. You are responsible for the code that is executed in Joyride. Joyride includes a Language Model Tool that gives CoPilot access to the scripting environment so that it can hack your editor while your are working with it. You can also ask CoPilot to create Joyride scripts for you. We're still discovering how to best instruct the AI for helping with Joyride scripting. You can use these custom instructions as a start. And please share your experiences with custom instructsions with us. 🙏 If you don't want CoPilot to see the Joyride REPL tool, then disable it in settings: Quick Start - Start your Scripts LibraryJoyride lets you bind keyboard shortcuts to its User and Workspace scripts.
Let's go with a Workspace script: Create a folder and open it in VS Code. Both the scripts here do almost the same thing: They show an information message and writes to a file in the root of the workspace. Create both, why don't ya? Using JavaScriptCreate the file
Using ClojureScriptCreate the file
Bind the scripts to a keyboard shortcut.You can run the scripts from the Joyride: Run Workspace Script.. menu. But for the exercise we'll create keyboard shortcuts too: In your keyboard shortcuts JSON file, add:
Now you can run the scripts from the keyboard shortcuts! Note: Because of how VS Code renders the command palette it is good to add the default
See doc/configuration.md for full configuration options. Quickest Start - Run some CodeThis currently only works with ClojureScript code:
Quickest Start - Evaluate the selectionOnly works with ClojureScript code:
Quick Start - Start the REPLWhile developing Joyride scripts you should of course do it leveraging Interactive Programming (see this video demonstrating it). nREPL ServerJoyride has an nREPL server and commands for starting and stopping it. By default, the server will be bound to Speaking of Calva. It has a command for starting the Joyride nREPL server and connect to it in one go. This video demonstrates starting from scratch, including installing Joyride. https://user-images.githubusercontent.com/30010/167246562-24638f12-120b-48e9-893a-7408d5beeb77.mp4 The demo ”project” used here is only a directory with this file
ExamplesSee the examples for examples including:
Support and feedbackYou'll find us in the NewsFollow the #vsjoyride hashtag on Twitter! |