Users access IDE functionality via commands and the command palette, but tools and libraries cannot add these to VSCode except via an extension.
Calva Power Tools is a contributor friendly way for library and tool authors to provide commands in VSCode without making a separate extension.
Contributing
Issues and pull requests are welcome. Please see CONTRIBUTING
npm run watch. This starts Clojure with an nREPL server. (You can run the build task command inside VSCode).
Wait for it to report something like:
nREPL server started on port 56749 on host localhost - nrepl://localhost:56749
ctrl+alt+c ctrl+alt+c. This runs the command: Calva: Connect to a Running REPL Server in the Project
It will connect the Clojure REPL, start a ClojureScript (shadow-cljs) REPL, and build the extension.
This will compile the extension and run the tests. Wait for the Build+watch extension to show that the tests have ran, and for Calva to pop up a progress dialog looking something like so:
Hint: The ClojureScript app is your extension.
F5. This starts the VS Code Development Extension Host (because configured to do so in .vscode/launch.json)
The development extension host is a VS Code window where your extension under development is installed. You now need to activate it to actually start the ClojureScript app.
The extension auto-activates, now your ClojureScript app and its REPL is started 🎉
Back in the development project you will see the progress dialog go away. Because now the development project window is connected to the Development Extension Host window's REPL.
Now you can hack on the extension code, which will update the app in the extension host window while it is running (a.k.a. interactive programming).
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.
License
MIT
Free to use, modify and redistribute as you wish. 🍻🗽