Skip to content
This repository has been archived by the owner on Jul 24, 2019. It is now read-only.

How to Contribute

Peter Strömberg edited this page Oct 5, 2018 · 7 revisions

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.

The setup:

  1. Fork and clone your fork.
  2. Create a new branch for your changes. (See below for choosing where to branch off from.)
  3. npm install
  4. Open the project root directory in VS Code (code . if you have set up things like a boss)

The dev process:

  1. In VS Code: Tasks -> Run Build Task… -> Watch CLJS. Wait for it to compile the CLJS code and start watching.
  2. In VS Code: Tasks -> Run Build Task… -> Watch TS. Wait for it to compile the TypeScript code and start watching.
  3. Start the extension in debug mode (the Extension Host): F5.
  4. Connect Calva: ctrl+alt+v c and select the :calva-fmt-lib build.
  5. 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.)

Before sending pull requests

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.

After sending pull requests

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.

Clone this wiki locally