Commit graph

18 commits

Author SHA1 Message Date
Will Lillis
3b67861def
fix(wasm): restore passing in ERROR to descendantsOfType (#4226) 2025-02-19 14:47:10 -08:00
Amaan Qureshi
a40265cbeb refactor(web): rename tree-sitter.js to web-tree-sitter.js
This is not breaking for consumers of the web bindings, nor the
playground as both filenames will be kept in the .github.io repo
2025-02-11 22:56:50 -05:00
Amaan Qureshi
9d62f17bc4 fix(web): correct doc comment 2025-01-28 20:59:37 -05:00
Allan Clements
cda634a1c4 feat: add error information in the progress callback
This allows users to bail parsing if an error was *definitely* detected
using the progress callback, as all possible stack versions have a
non-zero error cost.

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2025-01-25 02:47:39 -05:00
Amaan Qureshi
8bb1448a6f feat: add the semantic version to TSLanguage, and expose an API for retrieving it 2025-01-25 01:14:30 -05:00
Amaan Qureshi
e1eb2fdbca refactor(web): break apart the logic for constructing a query 2025-01-23 00:43:27 -05:00
Amaan Qureshi
b5894fac95 feat(web): use custom error type for query errors 2025-01-23 00:43:27 -05:00
Amaan Qureshi
6c3eb760a9 feat: improve PredicateStep types 2025-01-23 00:43:27 -05:00
Amaan Qureshi
e901716ebd refactor(web)!: deprecate Language.query in favor of new Query 2025-01-23 00:43:27 -05:00
Amaan Qureshi
e874d2d8f8 feat: add a patternIndex field to QueryCapture
This lets users look up the predicates associated with a given
`QueryCapture`, by using the `patternIndex` field and calling
`predicatesForPattern`
2025-01-23 00:43:27 -05:00
Amaan Qureshi
d60c6f163d refactor(web)!: rename pattern to patternIndex in QueryMatch
This aligns with other bindings
2025-01-23 00:43:27 -05:00
Amaan Qureshi
e3ac504e86 refactor(web): move CaptureQuantifier definition 2025-01-23 00:43:27 -05:00
Amaan Qureshi
58662417a6 fix(web): only export public types
This avoids exporting extra unnecessary stuff in the final JS file
2025-01-23 00:43:27 -05:00
Amaan Qureshi
09cb4c5729 feat(web): document the API 2025-01-21 12:36:15 -05:00
Amaan Qureshi
10e6ecf162 feat: begin autogenerating web-tree-sitter.d.ts 2025-01-21 12:36:15 -05:00
Amaan Qureshi
be7716dfa7 feat(web)!: use the WASM module in the bindings, and not the other way around
Parser is no longer the default export, but you *must* call
`Parser.init()` before doing anything still
2025-01-21 12:36:15 -05:00
Amaan Qureshi
31ceb99603 feat: add and apply eslint config 2025-01-21 12:36:15 -05:00
Amaan Qureshi
2cae67892e feat(web)!: rewrite the library in TypeScript 2025-01-21 12:36:15 -05:00