Commit graph

5469 commits

Author SHA1 Message Date
Amaan Qureshi
4d6740980c fix(generate): improve display of token sets with escape characters 2025-01-10 02:58:38 -05:00
Amaan Qureshi
b75ca0b957 ci: update docs workflow 2025-01-10 02:58:38 -05:00
Amaan Qureshi
21d74b8482 docs: add mdbook-admonish for better tooltips 2025-01-10 02:58:38 -05:00
WillLillis
c8bd78a29c feat(playground): provide colored highlight for captures in code editor 2025-01-10 00:45:08 -05:00
WillLillis
2c6f70cc57 feat(xtask): add --watch option for build-wasm and
`check-wasm-exports` xtask commands
2025-01-08 13:27:20 -05:00
Guilherme Soares
207ef9796e
fix(wasm): check docker presence without arguments 2025-01-08 13:27:02 -05:00
WillLillis
cbf960ff20 fix(cli): remove double print of generate errors 2025-01-08 01:13:22 -05:00
dependabot[bot]
5a854e6030 build(deps): bump cc from 1.2.6 to 1.2.7 in the cargo group
Bumps the cargo group with 1 update: [cc](https://github.com/rust-lang/cc-rs).


Updates `cc` from 1.2.6 to 1.2.7
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.6...cc-v1.2.7)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-07 08:15:58 -05:00
Amaan Qureshi
68e707eb4f feat: support passing in a Rust regex in the grammar dsl 2025-01-06 20:52:19 -05:00
Damien Guard
4170f71dbc
feat(generate): add .exp and .lib files to gitignore template
On Windows, tree-sitter-cli creates parser.exp and parser.lib so ideally we'd exclude those automatically.
2025-01-06 16:13:39 -05:00
Amaan Qureshi
ba19fe31be test: ignore flaky test for now
We'll re-enable post-release & when grammars are updated
2025-01-06 01:55:15 -05:00
Amaan Qureshi
2814c00faa fix(web): correct getExtent
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-06 01:55:15 -05:00
Amaan Qureshi
45fa028201 feat(web): add missing API functions
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-06 01:55:15 -05:00
WillLillis
dcdd6ce2d2 feat(xtask): check wasm exports 2025-01-06 01:55:15 -05:00
Lucas Marçal
aea3a4720a fix(endian): support POSIX mode on Apple platforms 2025-01-06 01:13:04 -05:00
Lucas Marçal
28d5272e71 build(swift): include all source files 2025-01-06 01:13:04 -05:00
WillLillis
767b5486c6 docs: clarify data returned by QueryCaptures during iteration 2025-01-05 03:01:36 -05:00
WillLillis
867433afd7 feat(rust): use thiserror for generate crate
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-05 00:27:12 -05:00
WillLillis
5a825a0930 feat(cli): add json summary of parsing 2025-01-05 00:27:12 -05:00
Amaan Qureshi
ef39298342 feat(wasm): add Supertype API 2025-01-05 00:14:09 -05:00
Riley Bruins
86b507a842 ci: regenerate fixtures upon changes to parser.h, alloc.h, array.h
This makes sense because the files are moved to `src/tree_sitter` upon
generation
2025-01-05 00:14:09 -05:00
Riley Bruins
19482834bd feat: add Supertype API
Introduces a new function that takes in a supertype symbol and returns
all associated subtypes. Can be used by query.c to give better errors
for invalid subtypes, as well as downstream applications like the query
LSP to give better diagnostics.
2025-01-05 00:14:09 -05:00
WillLillis
07c08432ca fix(rust): use PathBuf for --query-paths highlight option 2025-01-04 04:12:24 -05:00
WillLillis
619d347f95 chore: fix doc comment 2025-01-04 04:12:24 -05:00
Amaan Qureshi
efc51a596c fix(lib): don't consider unfinished captures definite when the following step is immediate
When collecting captures, we were treating unfinished ones as definite
even if they had pending immediate steps that weren't yet satisfied. Now
we only mark a capture as definite if the pattern is guaranteed and
there are no pending immediate steps to check.
2025-01-04 02:03:41 -05:00
Amaan Qureshi
5f379da544 fix(lib): prevent wildcards from incorrectly marking child patterns as infallible
When a pattern appears under a wildcard parent (like "(_ (expr))"), we
were incorrectly marking it as infallible. The parent_pattern_guaranteed
flag only means the pattern will match after finding the right wildcard
parent, not that any wildcard parent will work.
2025-01-03 23:09:49 -05:00
Amaan Qureshi
a7e6d01144 fix(lib): propagate last_child status to pattern alternatives in queries
Previously, when a pattern was marked as the last child in a query, its
alternatives weren't marked similarly, causing incorrect matching
behavior. Now, the `last_child` status is properly propagated through
all alternatives.
2025-01-03 21:13:29 -05:00
Will Lillis
f8e77aa99d
style: move command help strings to doc comments 2025-01-03 17:29:07 -05:00
WillLillis
a2f6b96683 docs: add --test-number entries for query, highlight, and tag subcommands 2025-01-03 16:16:17 -05:00
Amaan Qureshi
16be945cdd feat(cli): rework tags to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi
55fda55b9b feat(cli): rework highlight to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi
88d2f010f5 feat(cli): rework query to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi
6bad1bc6c5 feat(cli): rework parse to use new input handler
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi
b3183363a2 feat(loader): add a way to get the cwd's language config
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi
cc449ad965 feat(cli): make input handling agnostic
Co-authored-by: Will Lillis <will.lillis24@gmail.com>
2025-01-03 16:16:17 -05:00
Amaan Qureshi
3456330fe9 fix: update outdated links 2025-01-03 15:09:33 -05:00
dependabot[bot]
2c064039c7 build(deps): bump emscripten to 3.1.74 2025-01-02 22:10:49 -06:00
dependabot[bot]
6ef4432718 build(deps): bump the cargo group across 1 directory with 7 updates
Bumps the cargo group with 6 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [bstr](https://github.com/BurntSushi/bstr) | `1.11.1` | `1.11.3` |
| [cc](https://github.com/rust-lang/cc-rs) | `1.2.5` | `1.2.6` |
| [clap_complete_nushell](https://github.com/clap-rs/clap) | `4.5.4` | `4.5.5` |
| [glob](https://github.com/rust-lang/glob) | `0.3.1` | `0.3.2` |
| [serde](https://github.com/serde-rs/serde) | `1.0.216` | `1.0.217` |
| [tempfile](https://github.com/Stebalien/tempfile) | `3.14.0` | `3.15.0` |



Updates `bstr` from 1.11.1 to 1.11.3
- [Commits](https://github.com/BurntSushi/bstr/compare/1.11.1...1.11.3)

Updates `cc` from 1.2.5 to 1.2.6
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.5...cc-v1.2.6)

Updates `clap_complete_nushell` from 4.5.4 to 4.5.5
- [Release notes](https://github.com/clap-rs/clap/releases)
- [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md)
- [Commits](https://github.com/clap-rs/clap/compare/clap_complete_nushell-v4.5.4...clap_complete_nushell-v4.5.5)

Updates `glob` from 0.3.1 to 0.3.2
- [Release notes](https://github.com/rust-lang/glob/releases)
- [Changelog](https://github.com/rust-lang/glob/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/glob/compare/0.3.1...v0.3.2)

Updates `serde` from 1.0.216 to 1.0.217
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.216...v1.0.217)

Updates `serde_derive` from 1.0.216 to 1.0.217
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.216...v1.0.217)

Updates `tempfile` from 3.14.0 to 3.15.0
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.14.0...v3.15.0)

---
updated-dependencies:
- dependency-name: bstr
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: clap_complete_nushell
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: glob
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: serde_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: cargo
- dependency-name: tempfile
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-02 22:10:49 -06:00
Amaan Qureshi
2304109eab ci: fix typo 2025-01-02 21:40:49 -06:00
Amaan Qureshi
0a58175e46 ci(emscripten): set the git user and email with the cli 2025-01-02 21:40:49 -06:00
dependabot[bot]
af6f668659 ci: bump actions/configure-pages from 4 to 5 in the actions group
Bumps the actions group with 1 update: [actions/configure-pages](https://github.com/actions/configure-pages).


Updates `actions/configure-pages` from 4 to 5
- [Release notes](https://github.com/actions/configure-pages/releases)
- [Commits](https://github.com/actions/configure-pages/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/configure-pages
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-02 21:12:33 -06:00
Owen Shepherd
77f74a05c7
chore(generate): remove unused fields 2025-01-02 22:11:04 -05:00
WillLillis
cd3d967f3c fix(cli): correct range in cst pretty printer 2025-01-01 23:55:16 -05:00
Will Lillis
c712276676
ci: use correct xtask command to update emscripten 2024-12-30 20:11:12 -05:00
Amaan Qureshi
490f79bca2 ci: don't install cross if it already exists 2024-12-29 00:54:16 -05:00
Amaan Qureshi
22f67e2b67 fix(query): ensure immediate matches for any node when an anchor follows a wildcard node 2024-12-29 00:54:16 -05:00
Amaan Qureshi
d87d4592e0 test(rust): correct expected and actual spots in assert_eq calls 2024-12-29 00:54:16 -05:00
Amaan Qureshi
5d99014bb8 style: rephrase extends beyond to contains or starts after 2024-12-28 18:53:08 -05:00
Amaan Qureshi
d2db7eb8ef
docs: add back detailed info about points 2024-12-28 16:12:45 -05:00
Will Lillis
4f9869142f
fix(rust): adapt to a few new nightly lints 2024-12-28 01:17:04 -05:00