Commit graph

905 commits

Author SHA1 Message Date
Max Brunsfeld 8dcf851739 Add unit test for querying within a range of a long top-level repetition 2023-02-16 12:03:51 -08:00
Max Brunsfeld 837899e456 Add API for checking if a pattern in a query is non-local 2023-02-16 11:59:34 -08:00
Max Brunsfeld 40703f110c Fix bug in maintenance of query cursor's tree depth 2023-02-16 11:59:34 -08:00
Max Brunsfeld bd63fb2a0d Tweak query tests 2023-02-16 11:59:34 -08:00
Max Brunsfeld ff2436a6f8 Add --row-range, --quiet, and --time flags to query subcommand 2023-02-14 14:41:25 -08:00
Max Brunsfeld 125503ff3b Fix CLI build on windows 2023-02-13 23:40:06 -08:00
Max Brunsfeld 97fd990822 Add --dot flag to parse subcommand, for printing tree as DOT graph 2023-02-13 12:33:34 -08:00
Andrew Hlynskyi 6f42c78f2d
Merge pull request #2019 from verhovsky/error-message
cli: make error message more specific for building in `docker`
2023-01-27 11:45:04 +02:00
sogaiu 23ce370fa3 cli: Stop config.json search sooner if TREE_SITTER_DIR set 2023-01-16 15:30:40 +09:00
sogaiu adeb8d0aa9 cli: Make init-config respect TREE_SITTER_DIR 2023-01-16 15:30:38 +09:00
Andrew Hlynskyi f627a97d24 loader: use portable way of path joining 2023-01-11 04:12:13 +02:00
Andrew Hlynskyi c7d431b53e Add setting TREE_SITTER_DEBUG in the test subcommand
Were asked in #1218
2023-01-10 10:47:24 +02:00
Boris Verkhovskiy 61b85b2664 Make error message more specific 2023-01-08 08:10:14 -07:00
Andrew Hlynskyi 108d0ecede loader: add TREE_SITTER_LIBDIR; cli: add --libdir to tree-sitter generate
Closes #1336
2023-01-06 10:28:47 +02:00
Andrew Hlynskyi 5088781ef9 cli: add -b, --build flags for tree-sitter generate 2023-01-06 10:28:47 +02:00
Andrew Hlynskyi ad45f5cd2c Remove unused no-minimize arg for the generate command 2023-01-06 10:28:47 +02:00
Andrew Hlynskyi 88fe1d00c4 Bump Emscripten version to 3.1.29 2023-01-06 08:32:31 +02:00
Andrew Hlynskyi b1024a1493 cli: Fix build.rs in case of the current branch ref was packed
Support SHA lookup in .git/packed-refs
2023-01-03 00:44:01 +02:00
Andrew Hlynskyi c669e5ee15 Fix permanent rebuild triggering in a git worktree due to wrong git branch file path 2022-12-11 19:16:20 +02:00
Andrew Hlynskyi 870fb8772f
Merge pull request #1953 from tree-sitter/fix/playground-port-bind-racing
fix(cli): Racing on playground webserver port binding
2022-11-16 06:28:43 +02:00
Max Brunsfeld 8883d43bee
Merge pull request #1941 from mliszcz/master
Fix test output formatting for rules starting with M/U
2022-11-15 17:13:39 -08:00
Max Brunsfeld 1f36bf091e Upgrade to emscripten 3.1.25 2022-11-15 16:39:17 -08:00
Jonathan Arnett 813216be9a Configure compiled WASM grammars to not catch rejections 2022-11-15 16:39:17 -08:00
mliszcz 7bf2484d81 Fix test output formatting for rules starting with M/U
Previously the rule names could not begin with an uppercase M or U
because the test output formatter assumed that they represent special
tokens: MISSING or UEXPECTED.

Fixes #1940.
2022-11-15 20:20:44 +01:00
Max Brunsfeld 8e3dc7cd7a Add tests that randomly edit files with disjoint included ranges 2022-11-14 16:04:37 -08:00
Max Brunsfeld d07f864815 Fix parse error when reusing a node at the end of an included range 2022-11-11 16:34:57 -08:00
Andrew Hlynskyi a33e9141a8 fix(cli): Racing on playground webserver port binding 2022-11-09 04:56:52 +02:00
Max Brunsfeld da6e24de17 Fix adjustment of trees' included ranges on edits
Previously, when an included range started or ended *inside* of
an edit, that range did not get updated correctly.

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
2022-11-07 16:52:19 -08:00
Max Brunsfeld f0177f216e Use library-configured allocator to free intermediate included ranges 2022-11-07 10:48:32 -08:00
Max Brunsfeld b268e412ad 0.20.7 2022-09-02 15:00:47 -07:00
Max Brunsfeld e2fe380a08 Generate parsers with ABI version 14 by default 2022-09-02 12:31:29 -07:00
Max Brunsfeld 1b86ccecc8
Merge pull request #1845 from tree-sitter/root-node-with-offset
Add API for applying a positional offset when accessing a tree's nodes
2022-08-25 10:51:20 -07:00
Max Brunsfeld 6b87326470
Merge pull request #1787 from kianmeng/fix-typos
Fix typos
2022-08-25 10:25:39 -07:00
Max Brunsfeld be442a8f3a
Merge pull request #1831 from shaded-enmity/addr-port-env-vars
Add env vars for port and address
2022-08-25 10:23:27 -07:00
Max Brunsfeld 53ed4cf037 Tolerate tree edits whose old range extends beyond the end of the tree 2022-08-25 10:20:40 -07:00
Max Brunsfeld 477b667753 Add ts_tree_root_node_with_offset API 2022-08-18 13:48:47 -07:00
Nat Mote 4e3179fbc0
Avoid extracting default alias for extras
Fixes #1834
2022-08-10 07:27:34 -07:00
Pavel Odvody d6c451dc60
Add env vars for port and address
Make it possible to pass port and address via
pair of environmental variables TREE_SITTER_PLAYGROUND_PORT
and TREE_SITTER_PLAYGROUND_ADDR, respectively.

Signed-off-by: Pavel Odvody <pavel@redhat.com>
2022-08-02 14:54:45 +02:00
Max Brunsfeld 548c12fb88 Fix bug where patterns with top-level alternatives were not considered 'rooted' 2022-07-07 17:53:54 -07:00
Max Brunsfeld 1401767689 query: Don't attempt to match top-level sibling patterns directly in ERROR nodes
Co-authored-by: Keith Simmons <keith@zed.dev>
2022-07-07 15:27:00 -07:00
Kian-Meng Ang b8552ec6c4 Fix typos 2022-06-28 19:57:42 +08:00
Max Brunsfeld 8b5ff2ec8f Loosen randomized changed range assertions on newline characters
For now, don't error if the scope changes for a newline character.
2022-06-25 17:13:46 -07:00
Max Brunsfeld 58b719541b Fix failure to match queries with wildcard at root with range restrictions 2022-06-22 15:54:06 -07:00
Max Brunsfeld 46a2a5933f
Merge pull request #1748 from jamessan/cli-min-ts-ver
cli: Bump tree-sitter dependency to 0.20.3
2022-06-04 13:35:57 -07:00
rhysd 21c6cd8c22 cli: fix warnings from cargo doc 2022-05-31 10:59:30 +09:00
James McCoy d11841f6ba
cli: Bump tree-sitter dependency to 0.20.3
tree-sitter/tree-sitter#1504 added the capture_quantifiers API and its
usage in tree-sitter-cli, so the version should express the dependency.
2022-05-17 11:07:55 -04:00
Max Brunsfeld cfbafabe6f
Merge pull request #1643 from fengT-T/master
Fix: Set https proxy for npm cli install script
2022-04-26 09:54:04 -07:00
Aleksei Bavshin b27b4665ac
test: fix incorrect uses of i8 instead of c_char
Fixes build on aarch64, ppc64le and other platforms that have c_char
defined as u8.
2022-03-23 00:00:26 -07:00
Max Brunsfeld ccd6bf554d 0.20.6 2022-03-02 20:50:52 -08:00
Max Brunsfeld 7170ec7c96 Improve randomized testing setup
* Allow iterations to be specified via an env var
* Randomly decide the edit count, with a maximum
  specified via an env var.
* Instead of separate env vars for starting seed + trial, just accept a seed
* Remove some noisy output
2022-03-02 17:12:25 -08:00