Minimal CLJS VSCode extension using shadow-cljs
Installation
Clone this repo.
And it's dependencies:
npm install --save-dev shadow-cljs
The package.json
already contains the dependencies, but I wanted you to do this step, in case you later decide to create a new extension!
Fetch the other dependencies:
npm install
Compile (this takes a couple of second, later we'll learn how to reduce the compile time by using watch
!):
shadow-cljs compile dev
Start debugging (Debug > Start Debugging
)
're asked, select "Node.js" as environment.
Run the command by opening the command palette (View > Command Palette...
), then write "Hello World" and press Enter.
Voila!
Steps to utilize live reloading using shadow-cljs
In the extension.core
namespace we have a function called activate
. In it we tell vscode to run a lambda function when the extension is activated. activate
is only called once, so even if we edit the message and reload our code, we won't see any change. You can try this by doing the following:
- Be debugging (i.e. where you left off after following the Installation-steps)
- In same terminal as before (that is, not in the debug instance of vscode):
shadow-cljs watch dev
- Make a change in the call to
showInformationMessage
, e.g. (showInformationMessage "Hella World!")
- Run the command "Hello World" from the command palette again.