Commit graph

25 commits

Author SHA1 Message Date
Amaan Qureshi
8943983df6 feat!: properly handle UTF-16 endianness encoding 2024-10-05 21:12:48 -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
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
5c2f80ebb0 fix(bindings/wasm): fix Parser.getIncludedRanges() 2024-03-12 02:29:35 -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
Tom Beckmann
b407b5588d binding_web: expose Node.fieldNameForChild(index) function 2023-08-03 16:02:51 +02: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
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
Douglas Creager
b742e88108 Use TRANSFER_BUFFER for did_exceed_match_limit
This bridges the gap between how the C API reports this for a query
cursor, but the wasm API defines the method on a query.  Whenever you
call a query method that might exceed the match limit, we call the C API
function and transfer the result across the wasm boundary, storing the
result in the JavaScript wrapper class.
2021-04-28 15:46:12 -04:00
Douglas Creager
e8eb3c5d5a binding_web: Add Query.didExceedMatchLimit
This lets wasm clients check whether a query exceeded its maximum number
of in-progress matches.
2021-04-27 09:21:38 -04:00
hvithrafn
752372ee09 Add several bindings for Language 2021-02-01 13:01:10 -07:00
Max Brunsfeld
a2d6048226 Get the wasm build working w/ latest emscripten 2020-11-30 14:28:27 -08:00
Max Brunsfeld
096126d039 Allow predicates in queries, to match on nodes' text 2019-09-15 22:06:51 -07:00
Max Brunsfeld
307a1a6c11 Avoid wasm calls in Node.startIndex and Node.startPosition 2019-09-13 15:38:30 -07:00
Max Brunsfeld
a1fec71b19 Tweak QueryCursor to allow iterating either matches or captures
For syntax highlighting, we want to iterate over all of the captures in 
order, and don't care about grouping the captures by pattern.
2019-09-13 15:19:04 -07:00
Max Brunsfeld
49ce2fddb9 Add wasm binding for running tree queries in a limited range 2019-09-12 12:14:04 -07:00
Max Brunsfeld
c71de5bd81 Tweak query interface
* Rename TSQueryContext -> TSQueryCursor
* Remove the permanent association between the cursor and its query. The 
cursor can now be used again for a different query.
2019-09-11 17:33:48 -07:00
Max Brunsfeld
c8c75782e3 Allow tree queries to execute within a limited range 2019-09-11 16:49:29 -07:00
Max Brunsfeld
52cda5f541 Start work on wasm binding to query API 2019-09-10 20:54:21 -07:00
Max Brunsfeld
82fab90c0b web: Add bindings for remaining field APIs 2019-09-04 09:30:36 -07:00
Max Brunsfeld
f00b310908 wasm: Implement Node.descendantsOfType 2019-07-17 08:58:46 -07:00
Max Brunsfeld
1a33f1a665 Add TreeCursor.currentFieldName to wasm binding 2019-07-10 14:31:10 -05:00
Max Brunsfeld
0d70b485c0 Implement Wasm binding for Tree.getChangedRanges() 2019-05-09 23:52:57 -07:00
Max Brunsfeld
3fc459a84b Reorganize language bindings
* Move rust binding: lib/binding -> lib/binding_rust
* Move wasm bindinig: lib/web -> lib/binding_web
* Add wasm readme
2019-05-07 10:41:49 -07:00
Renamed from lib/web/binding.c (Browse further)