Commit graph

866 commits

Author SHA1 Message Date
Max Brunsfeld
b40a42ac0f Remove vendored wasmtime headers
When building rust binding, use wasmtime headers provided via cargo
by the wasmtime-c-api crate.

Co-authored-by: Marshall <marshall@zed.dev>
2024-02-26 10:48:58 -08:00
Amaan Qureshi
f1eecf9786 feat: expose the allocator and array header files for external scanners 2024-02-26 09:43:13 -05:00
Amaan Qureshi
068e29c265 build: unify crate versions via workspace 2024-02-24 18:30:04 -05:00
Max Brunsfeld
9301c1e676
Merge pull request #3068 from tree-sitter/load-old-language-via-wasm-crash
Fix crash when attempting to load ancient languages via wasm
2024-02-23 12:24:01 -08:00
Max Brunsfeld
8dded3ab60 Fix crash when attempting to load ancient languages via wasm 2024-02-23 11:48:14 -08:00
Amaan Qureshi
037c71c7bd fix: apply some scan-build suggestions (unused assignment/garbage access) 2024-02-21 15:38:13 -05:00
Amaan Qureshi
a5b7c2a584
fix: publish 0.21.0 to registries 2024-02-21 15:11:37 -05:00
Amaan Qureshi
a996fb322f build(deps): bump wasmtime to v18.0.1 2024-02-21 03:39:55 -05:00
Max Brunsfeld
f8eead9703 Use published wasmtime crates 2024-02-20 23:06:22 -08:00
Amaan Qureshi
fd91404ab0 style: tidying 2024-02-19 16:00:50 -05:00
Amaan Qureshi
f526be8061 test: update html tests 2024-02-19 06:36:48 -05:00
Matthew Smith
15e6cd1c35
refactor: name anonymous types in api.h
Anonymous structs cannot be forward declared.  This change names anonymous
types in api.h so that consumers can forward declare them.
2024-02-17 13:55:11 +01:00
Amaan Qureshi
caa451f024 fix: don't log NUL characters
Graphviz dot will fail with this character present
2024-02-17 03:24:42 -05:00
Amaan Qureshi
d80d101e34 build: move common Cargo.toml keys into the workspace and inherit them 2024-02-14 14:56:23 -05:00
dependabot[bot]
e8a818d0b9 build(deps): bump wasmtime from v16.0.0 to v17.0.1
Bumps [wasmtime](https://github.com/bytecodealliance/wasmtime) from v16.0.0 to v17.0.1.
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-some-possible-changes.md)
- [Commits](6613acd1e4...601e229d7a)

---
updated-dependencies:
- dependency-name: wasmtime
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-14 12:59:13 -05:00
Amaan Qureshi
4303ab99c9 fix: properly handle Query.matches when filtering out results 2024-02-13 16:40:05 -05:00
Amaan Qureshi
da0596ba38 chore: remove deprecated query parsing mechanism 2024-02-13 13:35:32 -05:00
Bedis Nbiba
c7ef6de315
docs(web): provide deno usage information 2024-02-11 03:39:38 -05:00
Amaan Qureshi
697e318a6c fix(wasm): remove C++ mangled symbols
No more upstream scanners use C++ so we're going to encourage to prefer
using C instead. It is just much easier to work with overall
2024-02-09 06:58:56 -05:00
dundargoc
ce191e02c5 fix: use correct printf specifiers 2024-02-08 22:46:43 +01:00
Amaan Qureshi
a969fc428c chore: move dependencies into the workspace and inherit from there 2024-02-08 15:24:09 -05:00
Amaan Qureshi
7980669267 feat: support dot graph output on windows 2024-02-08 15:21:47 -05:00
dundargoc
ff367ebf4c build: enable -pedantic
Co-authored-by: Patrick Thomson <patrickt@github.com>
2024-02-08 16:12:54 +01:00
dundargoc
df1fe842eb docs: various fixes
Closes https://github.com/tree-sitter/tree-sitter/issues/1317.
Closes https://github.com/tree-sitter/tree-sitter/issues/1752.
Closes https://github.com/tree-sitter/tree-sitter/issues/2439.

Co-authored-by: Simon Hengel <sol@typeful.net>
Co-authored-by: Akash Yadav <itsaky01@gmail.com>
Co-authored-by: Sebastiaan Speck <12570668+sebastiaanspeck@users.noreply.github.com>
Co-authored-by: Laytan Laats <laytanlaats@hotmail.com>
2024-02-08 00:08:59 +01:00
Thanabodee Charoenpiriyakij
9fb06643f3
docs: fix incorrect Tree::edit example in README.md 2024-02-07 21:24:02 +01:00
Amaan Qureshi
96a440af35 chore(web): add and apply eslint formatting 2024-02-07 12:18:44 -05:00
dundargoc
c8bd6705cf
chore: clippy 2024-02-06 23:34:14 -05:00
dependabot[bot]
3d849cb40e
build(deps): bump bindgen from 0.66.1 to 0.69.4
Bumps [bindgen](https://github.com/rust-lang/rust-bindgen) from 0.66.1 to 0.69.4.
- [Release notes](https://github.com/rust-lang/rust-bindgen/releases)
- [Changelog](https://github.com/rust-lang/rust-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/rust-bindgen/compare/v0.66.1...v0.69.4)

---
updated-dependencies:
- dependency-name: bindgen
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 20:16:49 -05:00
Douglas Creager
44aa80d678
feat: include build script links in Rust bindings
This patch updates the Rust binding's build script to output [build
metadata][links].  This makes it easier for downstream crates to
determine the include path, in case they need to compile their own C
code that requires the tree-sitter headers.

[links]: https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key
2024-02-05 20:05:05 -05:00
Max Brunsfeld
11e73bedc3 Remove unnecessary static lifetime 2024-02-05 11:57:24 -08:00
Max Brunsfeld
f4788b49c0 Merge branch 'master' into wasm-stdlib 2024-02-05 11:55:58 -08:00
Max Brunsfeld
63f34236e3 Add iswxdigit to wasm stdlib 2024-02-05 10:20:27 -08:00
Amaan Qureshi
28bb2a8c1c
chore(lib): apply clippy fixes 2024-02-04 04:18:59 -05:00
Max Brunsfeld
e054de4191 Return an error from build-wasm if scanner uses unavailable functions 2024-02-02 12:04:49 -08:00
Max Brunsfeld
f383b02741 Add iswblank wasm stdlib function 2024-02-02 12:04:49 -08:00
Max Brunsfeld
d2900510f6 Remove duplicate specification of stdlib symbols for web tree-sitter 2024-02-02 12:04:49 -08:00
Max Brunsfeld
e21d9e7f93 Avoid duplication of list wasm stdlib symbol list 2024-02-02 12:00:08 -08:00
Amaan Qureshi
f4c40f6098
fix: do not install parser.h 2024-02-02 11:30:24 -05:00
Amaan Qureshi
8ab14a0ee5
fix(node): update tests 2024-02-02 11:30:24 -05:00
Max Brunsfeld
1d8975319c
Merge pull request #2840 from tree-sitter/language-reference-count
Introduce APIs for managing the lifetimes of languages, allow WASM languages to be deleted
2024-01-30 10:24:37 -08:00
Max Brunsfeld
d351f81b4a Release stale instances from wasm store when languages are dropped 2024-01-29 10:17:49 -08:00
Steven Kalt
d35efd4608
feat(cli): support building WASM via podman
Previously, `tree-sitter build-wasm` had the ability to build WASM
by using docker to pull in an image with a complete emscripten toolchain.
This commit adds the ability to use podman to do the same thing.

Using podman requires two notable changes:
1. Using the fully-qualified image name. Docker defaults to prepending
    `docker.io` to the image name, but podman does not.
2. Podman will mount the `/src/` volume as belonging to root unless
  `--userns=keep-id` is passed. I think podman's different
  volume-ownership is related to podman's daemonless execution and
  `--uidmap` functionality, but I'm not 100% sure.

To test, I ran
```sh
script/fetch-fixtures
script/generate-fixtures
script/generate-fixtures-wasm # <- the important one!
```

which worked as well as the docker version.
2024-01-29 00:50:32 -05:00
Marshall Roch
6eacca9606
fix documentation typos 2024-01-25 20:33:15 -05:00
Max Brunsfeld
c4142737ec Merge branch 'master' into language-reference-count 2024-01-25 12:43:56 -08:00
Amaan Qureshi
98be227227
0.20.9 2024-01-25 15:05:17 -05:00
Max Brunsfeld
3c66dd2d6c Add missing language return in ts_query_new
Co-authored-by: Antonio <antonio@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.dev>
Co-authored-by: Joseph <joseph@zed.dev>
2024-01-25 11:06:54 -08:00
Amaan Qureshi
ef5621c0e2
Merge pull request #2795 from savetheclocktower/fix-quantified-predicates
fix: Handle quantified predicates on `web-tree-sitter` properly
2024-01-25 13:31:40 -05:00
Max Brunsfeld
31c4044974 Bump wasmtime to v16 release 2023-12-31 11:33:28 -08:00
Max Brunsfeld
675da7bfe8 Free C error message properly when loading wasm language fails 2023-12-31 10:05:42 -08:00
Max Brunsfeld
4a8e4b1963 Allow wasm languages to be deleted 2023-12-27 15:00:16 -08:00