-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing
VS Code extensions are built in good ol' JavaScript. This guide assumes you have some basic understanding of working with JS, Node, NPM, etc. Before you delve deeper, install the project's necessary dependencies with npm install
!
Much of this extension is written in ClojureScript code. This section will detail how to get a running ClojureScript REPL in which said Cljs code can be loaded and played with.
Make sure you're using VS Code and have the Calva extension installed.
To start a ClojureScript REPL:
cmd + shift + p
- search for
Calva: Start a Project REPL and Connect...
- Select the aforementioned command
- Select
shadow-cljs
- Select
:lib/dev
checkbox [and the:test
checkbox if you want the tests to autorun on save] and then click OK - In the next prompt, select
:lib/dev
- Once the CLJS files have finished compiling, open a new terminal and run
npm run connect-repl
- Voila! Your code will now be re-compiled after every change. Try evaluating some code!
- You can hop into any Owlbear namespace and the use
cmd + shift + p
to find and select theCalva: Load Current File and...
command
- You can hop into any Owlbear namespace and the use
This video is a demonstration of the steps above.
To run the extension in a sandbox VS Code window:
- Run
npm run compile
- Press the green play button in your VS Code editor! This should open up a new sandbox VS Code window.
- I'd recommend opening the playground folder in the sandbox VS Code window, as the playground folder will have plenty of sample files to play around in!
- Look for owlbear commands with
cmd + shift + p
Here's a video demonstrating the steps above!
Owlbear relies heavily on Tree-sitter to do all the necessary language parsing Owlbear needs. You can find the Tree-sitter grammars Owlbear relies on in the languages
directory.
To get started with Tree-sitter:
- Install the Tree-sitter CLI tool, see here
- Run
make build-wasms
to init all the language submodules and build all of the necessary language WebAssembly files -
cd
into one of the language directories - Run
tree-sitter playground
to launch an in-browser editor for the language (should open on http://127.0.0.1:8000 by default); here you can write code and examine how Tree-sitter parses the code
You can contact me on Discord at sansarip
.