Skip to content

Latest commit

 

History

History
63 lines (42 loc) · 1.48 KB

development.md

File metadata and controls

63 lines (42 loc) · 1.48 KB

Development

Setup

tree-sitter setup

Some files in this repository are auto generated. For example src/parser.c. We do this so that users can download and use the grammar more easily. We don't expect the grammar to change frequently.

To work on the grammar, clone this repository and install NPM dependencies:

git clone https://github.com/cap-js-community/tree-sitter-cds.git
cd tree-sitter-cds
npm install

Note that you need tree-sitter in your $PATH. Either install it globally using NPM or other package managers (e.g. MacPorts) or install it locally using NPM and add the .bin directory to your $PATH:

export PATH="${PATH}:./node_modules/.bin/"

To generate the grammar and run our tests, use:

tree-sitter generate
tree-sitter test

Git

We use Conventional Commits and have a default commit message template, that has some tips. Install it via:

cd tree-sitter-cds
git config commit.template tools/etc/git-default-commit-message.txt

Debugging

For debugging this grammar, use nvim-treesitter/playground. Use their settings and ensure that you are using Neovim Nightly.

Docker

This repository provides a basic Dockerfile. It only serves for testing our build steps.

cd tree-sitter-cds
docker build --pull -t "tree-sitter-cds:dev" -f tools/Dockerfile .