-
Ensure the bug or idea was not already reported by searching on GitHub under Issues.
-
If you're unable to find an open issue addressing the problem, open a new one.
-
Open a new GitHub pull request with code changes.
-
Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable.
-
Be sure to write a relevant test case.
-
Ensure that you follow conventions :
- Use Conventional commit specification for your commit message ;
- Format js code with prettier using this configuration ;
- Be sure to rebuild the parser before creating the Pull request.
Refer to the tree-sitter documentation for more details and specifics.
To get started with contributing to the grammar you'll first need to install the project's dependencies:
npm install
The general flow will often start with adding a test case to ./corpus
. You can
find details on how testing works with tree-sitter
here.
Once you've added your test case you'll want to then make the required changes
to grammar.js
, regenerate and recompile the parser, and run the tests:
npm run build
npm run test
Then adjust as necessary. Note that depending on your change you may also have
to touch the /src/scanner.c
file if you need more advanced features like
look-ahead.