-
Notifications
You must be signed in to change notification settings - Fork 8
How to Contribute
Calva Formatter is mad using mainly ClojureScript. The CLJS code is compiled into a JavaScript library that is then used from TypeScript, which is used for the VS Code integration.
The library is build using shadow-cljs
.
- Fork and clone your fork.
- Create a new branch for your changes. (See below for choosing where to branch off from.)
npm install
- Open the project root directory in VS Code (
code .
if you have set up things like a boss)
You also want to switch off Calvas auto connect feature in Settings for this Workspace.
- In VS Code: Tasks -> Run Build Task… -> Watch CLJS. Wait for it to compile the CLJS code and start watching.
- In VS Code: Tasks -> Run Build Task… -> Watch TS. Wait for it to compile the TypeScript code and start watching.
- Start the extension in debug mode (the Extension Host):
F5
. - Connect Calva:
ctrl+alt+v c
and select the:calva-fmt-lib
build. - Switch back to the Watch CLJC task to see the test results when you save any cljs file.
As you edit code, shadow-cljs
will recompile the extension really fast, as will the TypeScript compiler. The test runner is triggered and results printed in the terminal where the Watch CLJS task is running. Currently the TS code is not tested. Mainly because I do not know how to do it, but also because I try to make the TS as thin a layer as possible.
You need to restart the Extension Host after each rebuild to test it. (If you know how to get live reload to work, please let me know.)
Make sure all tests pass. Try add some basic unit tests for any functionality in the ClojureScript code that you add or change.
Use the vsce
tool to package a vsix
file and install it manually in your VS Code and do some quick smoke testing that the production build works.
When you have issued your Pull Request it is best to ping us about it to catch our attention. The #editors
channel of the Clojurians Slack is a good place to ping us.