Skip to content

Commit edb932b

Browse files
committed
api: remove timeout_micros
It's depricated since a long time, and there's not reason for it to stay.
1 parent 710127d commit edb932b

2 files changed

Lines changed: 0 additions & 47 deletions

File tree

ext/tree_sitter/parser.c

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -352,44 +352,6 @@ static VALUE parser_reset(VALUE self) {
352352
return Qnil;
353353
}
354354

355-
/**
356-
* Get the duration in microseconds that parsing is allowed to take.
357-
*
358-
* @return [Integer]
359-
*
360-
* @note DEPRECATED in tree-sitter 0.26+. This API was removed.
361-
* Use TSParseOptions with progress_callback instead.
362-
*/
363-
static VALUE parser_get_timeout_micros(VALUE self) {
364-
// tree-sitter 0.26+ removed timeout_micros API
365-
// Return 0 to indicate no timeout (was the default behavior)
366-
(void)self; // suppress unused parameter warning
367-
return ULL2NUM(0);
368-
}
369-
370-
/**
371-
* Set the maximum duration in microseconds that parsing should be allowed to
372-
* take before halting.
373-
*
374-
* If parsing takes longer than this, it will halt early, returning +nil+.
375-
*
376-
* @see parse
377-
*
378-
* @note DEPRECATED in tree-sitter 0.26+. This API was removed.
379-
* Use TSParseOptions with progress_callback instead.
380-
*
381-
* @param timeout [Integer]
382-
*
383-
* @return [nil]
384-
*/
385-
static VALUE parser_set_timeout_micros(VALUE self, VALUE timeout) {
386-
// tree-sitter 0.26+ removed timeout_micros API
387-
// This is a no-op for backward compatibility
388-
(void)self; // suppress unused parameter warning
389-
(void)timeout; // suppress unused parameter warning
390-
return Qnil;
391-
}
392-
393355
void init_parser(void) {
394356
cParser = rb_define_class_under(mTreeSitter, "Parser", rb_cObject);
395357

@@ -412,6 +374,4 @@ void init_parser(void) {
412374
parser_parse_string_encoding, 3);
413375
rb_define_method(cParser, "print_dot_graphs", parser_print_dot_graphs, 1);
414376
rb_define_method(cParser, "reset", parser_reset, 0);
415-
rb_define_method(cParser, "timeout_micros", parser_get_timeout_micros, 0);
416-
rb_define_method(cParser, "timeout_micros=", parser_set_timeout_micros, 1);
417377
}

test/tree_sitter/parser_test.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,6 @@ def mul(a, b)
124124
end
125125
end
126126

127-
describe 'timeout_micros' do
128-
it 'must get/set timeout_micros' do
129-
parser.timeout_micros = 1
130-
assert_equal 1, parser.timeout_micros
131-
end
132-
end
133-
134127
# TODO: included_ranges for parsing partial documents.
135128

136129
# TODO: parsing with non-nil tree.

0 commit comments

Comments
 (0)