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.
This commit is contained in:
parent
a748488596
commit
3f424c0121
11 changed files with 132 additions and 8 deletions
1
lib/binding_web/tree-sitter-web.d.ts
vendored
1
lib/binding_web/tree-sitter-web.d.ts
vendored
|
|
@ -179,6 +179,7 @@ declare module 'web-tree-sitter' {
|
|||
endIndex?: number;
|
||||
matchLimit?: number;
|
||||
maxStartDepth?: number;
|
||||
timeoutMicros?: number;
|
||||
};
|
||||
|
||||
export interface PredicateResult {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue