Commit graph

254 commits

Author SHA1 Message Date
Amaan Qureshi 2cae67892e feat(web)!: rewrite the library in TypeScript 2025-01-21 12:36:15 -05:00
Amaan Qureshi 07a86b1729 build(web): use files in package.json instead of .npmignore 2025-01-21 12:36:15 -05:00
WillLillis cd6e766365 fix(wasm): allow passing in ERROR in descendantsOfType
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 14s
Check Bindgen Output / check-bindgen (push) Has been cancelled
Deploy Docs / deploy-docs (push) Has been cancelled
Check WASM Exports / check-wasm-exports (push) Has been cancelled
2025-01-11 03:00:20 -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
Amaan Qureshi ef39298342 feat(wasm): add Supertype API 2025-01-05 00:14:09 -05:00
Amaan Qureshi 5d99014bb8 style: rephrase extends beyond to contains or starts after
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 14s
CI / build (push) Failing after 15s
Check Bindgen Output / check-bindgen (push) Has been cancelled
Deploy Docs / deploy-docs (push) Has been cancelled
2024-12-28 18:53:08 -05:00
Felix Roos 6c4a50a9c7 docs(web): add instructions for Vite 2024-12-16 00:09:42 -05:00
WillLillis 5b5cf5a5e5 fix(lib): check point, byte ranges in ts_query_cursor_set
range functions
2024-11-02 03:06:07 -04:00
ObserverOfTime ac37e60559 refactor(web): use fs/promises
Some checks failed
CI / sanitize (push) Failing after 13s
CI / build (push) Failing after 13s
CI / checks (push) Has been cancelled
2024-10-15 16:10:23 +00:00
Amaan Qureshi 8943983df6 feat!: properly handle UTF-16 endianness encoding 2024-10-05 21:12:48 -04:00
Amaan Qureshi cf8ed78a9a feat: bump version to 0.25 2024-10-05 20:23:40 -04:00
Amaan Qureshi 693a403acd 0.24.1 2024-10-04 00:47:45 -04:00
Amaan Qureshi dfc891a5ce
0.24.0 2024-10-04 00:16:20 -04:00
Amaan Qureshi 8667e3ea0c fix(binding_web): remove nonexistent function definition
Some checks failed
CI / checks (push) Waiting to run
CI / sanitize (push) Failing after 11s
CI / build (push) Failing after 11s
2024-09-08 16:57:20 -04:00
Amaan Qureshi fcbd67b3fa fix(binding_web): correct edit signature 2024-09-07 17:53:18 -04:00
Amaan Qureshi 3f424c0121 feat: add an API to time out query executions
Currently, if a predicate is hard to match on the Rust side, a sizable
query against a very large file can take forever, and ends up hanging.
This commit adds an API function `ts_query_cursor_set_timeout_micros` to
limit how long query execution is allowed to take, thereby negating the
chance of a hang to occur.
2024-08-31 14:33:28 -04:00
Amaan Qureshi 12fb31826b
0.23.0
Some checks failed
CI / sanitize (push) Failing after 12s
CI / build (push) Failing after 13s
CI / checks (push) Has been cancelled
2024-08-26 09:07:00 -04:00
Boris Verkhovskiy cd3e561224
build(wasm): don't minify JS (#3380) 2024-07-29 10:00:02 +03:00
Amaan Qureshi 6304009209
fix(wasm): update test 2024-06-03 12:42:25 +02:00
Amaan Qureshi b40f342067
0.22.6 2024-05-05 16:47:18 -04:00
Adrien Friggeri 01bf431261
fix(wasm): correct childrenFromFieldXXX method signatures
These do not expect a `cursor` parameter
2024-04-16 13:48:53 -04:00
Max Brunsfeld cdd4688860 0.22.5 2024-04-14 10:17:04 -07:00
Max Brunsfeld 285257998c 0.22.4 2024-04-12 17:03:02 -07:00
Max Brunsfeld a3d338781b 0.22.3 2024-04-12 15:10:49 -07:00
Amaan Qureshi 96d18408a3 refactor(js): misc fixes & tidying 2024-04-11 22:35:43 -04:00
Amaan Qureshi c1a63019a4 chore: update tests 2024-04-08 17:56:05 -04:00
Amaan Qureshi 09d2b23a64 fix(lib): account for the root node of a tree cursor being an alias 2024-03-20 19:23:08 -04:00
Amaan Qureshi fc15f62133
0.22.2 2024-03-17 07:31:58 -04:00
Amaan Qureshi 99b93d83a1 feat(cli)!: add a separate build command to compile parsers
This allows users to build parsers without having to run `test` or
`parse` to invoke the compilation process, and allows them to output the
object file to wherever they like. The `build-wasm` command was merged
into this by just specifying the `--wasm` flag.
2024-03-17 05:36:30 -04:00
Amaan Qureshi 5c2f80ebb0 fix(bindings/wasm): fix Parser.getIncludedRanges() 2024-03-12 02:29:35 -04:00
Amaan Qureshi 1c38d34dea
0.22.1 2024-03-10 17:59:12 -04:00
Amaan Qureshi 0a5a564ea7
0.22.0 2024-03-10 17:15:08 -04:00
Amaan Qureshi 728793a160 feat(wasm)!: keep API in-line with upstream and start aligning with node 2024-03-10 03:02:17 -04:00
Boris Verkhovskiy c070c92722 refactor(wasm)!: make current*, is*, and has* methods properties 2024-03-08 00:27:06 -05:00
Amaan Qureshi a5b7c2a584
fix: publish 0.21.0 to registries 2024-02-21 15:11:37 -05:00
Amaan Qureshi f526be8061 test: update html tests 2024-02-19 06:36:48 -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 96a440af35 chore(web): add and apply eslint formatting 2024-02-07 12:18:44 -05:00
Max Brunsfeld d2900510f6 Remove duplicate specification of stdlib symbols for web tree-sitter 2024-02-02 12:04:49 -08:00
Amaan Qureshi 8ab14a0ee5
fix(node): update tests 2024-02-02 11:30:24 -05: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
Amaan Qureshi 98be227227
0.20.9 2024-01-25 15:05:17 -05: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
Andrew Dupont 642679f32a Simplify flags 2023-11-28 14:08:16 -08:00
Andrew Dupont 24e41d2bb7 fix: Handle quantified predicates on web-tree-sitter properly
Test cases for all new predicates added in #2532
2023-11-28 13:07:32 -08:00
Max Brunsfeld f4e2f68f14 Merge branch 'master' into wasm-language 2023-10-27 12:11:43 +01:00
dstoc 8d0997d5b4 Add towlower to wasm exports
tree-sitter/tree-sitter#1906
2023-09-20 10:41:54 +10:00
Amaan Qureshi 6d4aac723f
feat: add some more commonly used functions to exports.json 2023-09-19 09:29:13 -04:00
Amaan Qureshi ec88699f1c
test(node): update bash test 2023-08-31 18:26:22 -04:00
Amaan Qureshi 09030401d1
fix(node): add _isalpha 2023-08-31 17:58:42 -04:00
Amaan Qureshi 09ac28c77d
feat!: properly handle predicates used on quantified captures 2023-08-31 16:01:36 -04:00
Andrew Hlynskyi b22e4fe3c9 chore: fix a wasm bash test 2023-08-25 17:36:03 +03:00
Amaan Qureshi 7d953eb5ba
Merge pull request #2466 from tom95/add-field-name-for-child
Web Bindings: Expose fieldNameForChild C function
2023-08-18 12:20:39 -04:00
Andrew Hlynskyi 26c3ae7b98 Rename: ts_lookahead_iterator_advance -> ts_lookahead_iterator_next 2023-08-09 14:40:29 +03:00
Tom Beckmann b947145e53 add a test 2023-08-03 16:32:51 +02:00
Tom Beckmann b407b5588d binding_web: expose Node.fieldNameForChild(index) function 2023-08-03 16:02:51 +02:00
Daumantas Kavolis fd8fd3f535 Add tests for previous sibling, last child 2023-08-02 00:02:33 +03:00
Daumantas Kavolis e2c2e39e15 Delete parser and iterator 2023-08-02 00:02:33 +03:00
Daumantas Kavolis e2094ef202 Add wasm tests for lookahead iterator 2023-08-02 00:02:33 +03:00
Daumantas Kavolis ab788619ca Split wasm tests for next parse state 2023-08-02 00:02:33 +03:00
Daumantas Kavolis 1f52f2f1dc Symbols without aliases should be used for lookahead 2023-08-02 00:02:33 +03:00
Daumantas Kavolis c47e217e73 API extensions 2023-08-02 00:02:33 +03:00
Amaan Qureshi 1982e48568 chore: update exports to include some string.h functions 2023-07-10 15:21:39 -04:00
Max Brunsfeld a2119cb691 Add APIs for retrieving tree cursor's depth and descendant index 2023-06-12 11:50:44 -07:00
Andrew Hlynskyi 613382c70a docs: update badges; fix markdown lint complains
Linter config `.vscode/settings.json`:
```json
{
    "[markdown]": {
        "files.trimTrailingWhitespace": false,
    },
    "markdownlint.config": {
        "default": true,
        // "ul-style": {
        //     "style": "asterisk"
        // },
        "MD001": false,
        "MD024": false,
        "MD025": false,
        "MD033": false,
        "MD041": false,
        "MD053": false,
    },
}
```
2023-04-16 23:39:08 +03:00
Andrew Hlynskyi 90fca305bf Merge branch 'recover-web-v0.20.8' into master 2023-04-10 20:32:59 +03:00
Andrew Hlynskyi de906378ab web: 0.20.8 2023-04-10 19:50:32 +03:00
Andrew Hlynskyi 1f051d339c chore(docs): fix misprint repetitions and remove dangling spaces 2023-04-09 20:40:18 +03:00
Andrew Hlynskyi ec2af46f6f chore: remove all dead badges 2023-03-16 18:00:02 +02:00
Andrew Hlynskyi 47c1e858ef Update deps: lib/binding_web/package.json 2023-03-14 20:37:12 +02:00
Andrew Hlynskyi 19bd5868eb Fix wasm tests 2023-01-06 08:32:26 +02:00
Max Brunsfeld 35ce2e47ec web: Remove conditional logic for older emscripten versions 2022-11-15 17:27:01 -08:00
Jonathan Arnett e4fc6653ee Add __cxa_atexit to exports 2022-11-15 16:39:17 -08:00
Jonathan Arnett 56e9753b5f Add memset to exports 2022-11-15 16:39:17 -08:00
Max Brunsfeld 2be51abcd8 Bump library versions 2022-09-02 15:00:09 -07:00
Max Brunsfeld 15190a497d Build core wasm library with C++ exceptions disabled 2022-09-02 14:55:50 -07:00
Nicholas Yang 8131e7635e Added documentation on web-tree-sitter edge cases 2022-08-21 17:55:04 -04:00
Max Brunsfeld 1b2e90f647 libs: 0.20.6 2022-03-02 20:50:29 -08:00
Max Brunsfeld fcbef45899 libs: 0.20.5 2022-03-02 14:43:16 -08:00
Max Brunsfeld fab8540508 libs: 0.20.3 2022-01-21 16:35:37 -08:00
Owen Shepherd 1aa6541476
Add realloc to wasm exports 2022-01-03 16:07:39 +00:00
Max Brunsfeld 5d8a1ace56 web: 0.20.2 2021-12-30 17:14:04 -08:00
Max Brunsfeld 224e79ca27 web: Fix script directory that's passed to locateFile 2021-11-22 15:56:26 -08:00
Max Brunsfeld 42360fc003 Bump library versions to 0.20.1 2021-11-21 12:33:12 -08:00
Andrew Hlynskyi 79b2bf1c30 fix(wasm): Fix predicates in alternations, resolves #1392 2021-09-21 21:13:41 +03:00
Max Brunsfeld 5c2ebf093b Include memmove symbol in wasm build 2021-09-10 15:21:55 -07:00
Max Brunsfeld 0e26fbe5e6
Merge pull request #1367 from jrieken/moduleInit
Allow to pass Module object to init-function
2021-08-30 09:32:43 -07:00
Max Brunsfeld eeda44d837
Merge pull request #1368 from jrieken/dtsTweaks
Fixes and additions to tree-sitter-web.d.ts
2021-08-30 09:17:53 -07:00
Johannes Rieken 3e9874df7f Don't confuse terser with object spread 2021-08-30 14:56:28 +02:00
Johannes Rieken e7a8e73bbf fixes and additions to tree-sitter-web.d.ts 2021-08-30 14:47:47 +02:00
Johannes Rieken 12d727fd49 mix init options in the Module-global 2021-08-30 14:16:41 +02:00
Andrew Hlynskyi f15700c6bd chore(web): Add the LICENSE file to the web-tree-sitter npm package 2021-08-22 03:13:46 +03:00
Max Brunsfeld be69777350 libs: 0.20.0 2021-06-29 17:18:22 -07:00
Andrew Hlynskyi a286f831c7 Bump Emscripten version to 2.0.24 2021-06-30 01:06:33 +03:00
Douglas Creager ad3907c2a6 wasm: Add matchLimit option to query methods
This exposes the new configurable match limits for query cursors.
2021-06-02 13:51:00 -04:00
Max Brunsfeld 9d0eedc01f Remove stray entry from wasm exported-symbol list 2021-05-20 14:33:25 -07:00
Max Brunsfeld 242e089379 web: 0.19.4 2021-05-20 14:29:39 -07:00