Skip to content

dev: base make on sources, use project-local TS#359

Open
gthb wants to merge 1 commit into
tree-sitter:masterfrom
gthb:fix-makefile-cli-and-deps
Open

dev: base make on sources, use project-local TS#359
gthb wants to merge 1 commit into
tree-sitter:masterfrom
gthb:fix-makefile-cli-and-deps

Conversation

@gthb

@gthb gthb commented Mar 8, 2026

Copy link
Copy Markdown

Two Makefile improvements to spare newcomers like me some stumbles :)

  1. Default TS to npx tree-sitter instead of tree-sitter, to use the tree-sitter CLI version pinned in the project rather than whatever global binary happens to be on $PATH (which could result in arbitrary unrelated diffs in the generated parser)

  2. Change the Make rule for parser generation to depend on the actual sources grammar.js and ../common/define-grammar.js rather than the derived file src/grammar.json, so that editing a grammar source and running make regenerates src/grammar.json before regenerating the parser.

Spare newcomers like me from some stumbles :) with two Makefile improvements:

1. Default `TS` to `npx tree-sitter` instead of `tree-sitter`, to use the
   tree-sitter CLI version pinned in the project rather than whatever global
   binary happens to be on `$PATH`

2. Change the Make rule for parser generation to depend on the actual sources
   `grammar.js` and `../common/define-grammar.js` rather than the derived file
   `src/grammar.json`, so that editing a grammar source and running `make`
   regenerates `src/grammar.json` before regenerating the parser.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant