-
-
Notifications
You must be signed in to change notification settings - Fork 85
Language implementor tips
Josh Bleecher Snyder edited this page Sep 6, 2023
·
7 revisions
This page is odds-and-ends notes for new folks implementing a new language or migrating an existing language to treesitter.
- Sending small PRs is preferred. Make incremental progress.
- The scope visualizer supports hot reloading.
- Make good use of data/playground. Don't be shy about it. It'll help other folks in the future.
- In a PR description,
[x]
means "done",[ ]
means "not done yet", and[/]
means "N/A (not applicable)" - Attending meetups is strongly recommended. It's a great place to get questions about behavior answered.
- In a map/list,
"take item comma"
takes the items on both sides of the comma. Surprising, but intentional. - In maps/lists, the curly braces are not part of the item.
- Think about comments as you define scopes.
- Read https://github.com/cursorless-dev/cursorless/issues/1742, as it has useful information
- Use not just
visualize <scope>
but alsovisualize iteration <scope>
andvisualize removal <scope>
- The removal range is defined as a series of fallbacks:
.removal
if it exists (rare),.leading
if non-empty,.trailing
if non-empty, then just the range itself. - The treesitter query language only supports three captures for any given matched node. After that it silently ignores any captures you write! To work around this, you can duplicate the query.