Calva Power ToolsA VSCode extension, and Calva companion, for Clojure and ClojureScript development that adds commands for popular Clojure libraries and tools. Including commands for dynamically loading the tool dependencies. Usage
There is a quick demo/howto here: https://youtu.be/GiWKX-0NqkM Default keybindings includedThe Calva Power Tools extension generally contributes default keybindings for the commands. They are all chained on a first chord of ctrl+shift+space, a.k.a. the Power Key. Then, generally, each tool has its key, e.g. Snitch uses the Tool Key s. You can thus execute Snitch commands with ctrl+shift+space s something. There are also default bindings for filtering the command palette on a specific tool. Generally the ctrl+shift+space ctrl+shift+tool-key. E.g. to list the Snitch commands:
The ToolsA hopefully growing list of power tools. Tools-deps, add-libsA set of commands leveraging Clojure 1.12
Tool Key: d ClayTool Key: a Explore the Clay commands from the VS Code command palette by fuzzy searching “Clay”. Also check this intoduction out: https://www.youtube.com/watch?v=B1yPkpyiEEs SnitchSnitch is inline-defs on steroids. See https://github.com/AbhinavOmprakash/snitch. Search the command palette for “Snitch”. Tool Key: s This menu screenshot is showing the default key bindings. I (PEZ) am on a Mac and can recommend binding the Snitch: Instrument defn command to cmd+enter. PerformanceThere are commands for four important tools when chasing performance gains in Clojure. For loading dependencies as well as basic usage: Tool Key: s. Further each “sub-tool” has a key, c/d/p/t for Criterium/clojure-java-decompiler/clj-async-profiler/time, respectively. Example: Loading the dependency for Criteriums is ctrl+shift+space p c l, to be read as Power Tools, Performance, Criterium, Load. Criteriumclojure-java-decompilerclj-async-profilertimeDataspexDataspex is an easy to use, and powerful data inspection tool/browser for both frontend and backend applications. It supports watching atoms, Datascript, and Datomic databases. There is a browser extension so you can watch your frontend app's state where it runs. With Calva Power Tools it is easy to take it for a spin, without updating your project configuration. To use the browser extension, you'll need to install that separately, but without installing anything you can test Dataspex inside VS Code: With a ClojureScript frontend app you do this by using the command: [CPT] Dataspex: Show Browser Extension Inspects in VS Code Tool Key: x Backend workflowUse the Dataspex command palette to:
If you don't have the Dataspex dependency configured/loaded in your project, you will be offered to do tis dynamically (and this needs Clojure 1.12 or newer to work). Frontend workflowThis is the most convenient if you have Dataspex configured in the app to inspect the app's state atom/datascript db:
Then you can inspect other values using the Dataspex commands. Without Datspex configured in the project:
Backend + frontend workflowIn addition to the above workflows, you can use the Dataspex command palette to show server inspects in the browser extension. Use the REPL for the full Dataspex APIThe commands included in Calva Power Tools support the basic and common workflows. You can of course go beyond this by calling the Dataspex API yourself from the repl. ContributingIssues and pull requests are welcome. Please see CONTRIBUTING Adding a new command
DevelopmentThe paved path is:
An important thing to note here is the steps where you activate your extension in the development host, starting the ClojureScript repl which Calva can connect to. LicenseMIT Free to use, modify and redistribute as you wish. 🍻🗽 Built VSC-ET, the VS Code Extension Template |