Releases: tree-sitter/py-tree-sitter
Releases · tree-sitter/py-tree-sitter
v0.23.2
What's Changed
- Update documentation on
Query.captures()
by @Bzero in #306 - build: bump tree_sitter/core from
46bdc14
tof629fd4
by @dependabot in #307 - fix(query): iterate over captures for the shortest size, not longest by @amaanq in #309
New Contributors
Full Changelog: v0.23.1...v0.23.2
v0.23.1
What's Changed
- build: bump tree_sitter/core from
12fb318
toee06325
by @dependabot in #286 - ci: bump pypa/cibuildwheel from 2.20 to 2.21 in the actions group by @dependabot in #291
Full Changelog: v0.23.0...v0.23.1
v0.23.0
Additions:
Node.child_containing_descendant(descendant)
Tree.language
(getter)Query.pattern_count
(getter)Query.capture_count
(getter)Query.match_limit
(getter)Query.did_exceed_match_limit
(getter)Query.set_match_limit(match_limit)
: returnsself
Query.set_max_start_depth(max_start_depth)
: returnsself
Query.set_byte_range(byte_range)
: returnsself
Query.set_point_range(point_range)
: returnsself
Query.disable_pattern(index)
: returnsself
Query.disable_capture(capture)
: returnsself
Query.pattern_settings(index)
Query.pattern_assertions(index)
Query.start_byte_for_pattern(index)
Query.end_byte_for_pattern(index)
Query.is_pattern_rooted(index)
Query.is_pattern_non_local(index)
Query.is_pattern_guaranteed_at_step(offset)
QueryError
(exception class)QueryPredicate
(typing protocol)
Removals:
Parser.set_language(language)
Parser.set_included_ranges(ranges)
Parser.set_timeout_micros(timeout)
Node.sexp()
Tree.text()
TreeCursor.goto_first_child_for_point(row, column)
LookaheadIterator.reset(language, state)
Changes:
Language()
accepts a capsule as an argument.Parser.parse(...)
no longer accepts akeep_text
argument.Query.captures(...)
- Range arguments were removed (use
set_*
instead). - Added an argument for custom query predicates.
- Return type was changed to
dict[str, list[Node]]
.
- Range arguments were removed (use
Query.matches(...)
- Range arguments were removed (use
set_*
instead). - Added an argument for custom query predicates.
- Return type was changed to
list[tuple[int, dict[str, list[Node]]]]
.
- Range arguments were removed (use
TreeCursor.goto_first_child_for_byte(byte)
returnsint | None
.TreeCursor.goto_first_child_for_point(point)
returnsint | None
.
v0.22.3
Full Changelog: v0.22.2...v0.22.3
v0.22.2
Full Changelog: v0.22.1...v0.22.2
v0.22.1
Full Changelog: v0.22.0...v0.22.1
v0.22.0
Breaking changes are marked with !
.
Additions:
LANGUAGE_VERSION
MIN_COMPATIBLE_LANGUAGE_VERSION
Point(row, column)
Language.__repr__()
Language.__eq__()
: checksptr
Language.__int__()
: returnsptr
Language.__index__()
: returnsptr
Language.__hash__()
: returnsptr
Node.__str__()
: returns the S-expressionTreeCursor.goto_first_child_for_point(point)
TreeCursor.__copy__()
: returnscopy()
Query(language, source)
Parser(language, included_ranges, timeout_micros)
Parser.language
(getter + setter)Parser.included_ranges
(getter + setter)Parser.timeout_micros
(getter + setter)Range.__hash__()
Deprecations:
Node.sexp()
: usestr()
Tree.text
: useroot_node.text
TreeCursor.goto_first_child_for_point(row, column)
: usegoto_first_child_for_point(point)
LookaheadIterator.reset(language, state)
: usereset_state(state, language)
Parser.set_language(language)
: useParser(language)
orlanguage
setterParser.set_included_ranges(ranges)
: useincluded_ranges
setterParser.set_timeout_micros(timeout)
: usetimeout_micros
setter
Removals:
Language(path, name)
!Language.build_library(...)
!Language.name
!Language.lib
Language.language_id
: useint()
Changes:
Language()
only accepts a single integer argument. !Parser.parse(...)
accepts an optionalencoding
argument. !TreeCursor.descendant_index
is changed to a property. !LookaheadIterator.language
returns aLanguage
instance. !LookaheadIterator.reset_state(...)
accepts an optionallanguage
argument.Query.captures(...)
arguments must be keywords (except fornode
).Query.matches(...)
arguments must be keywords (except fornode
).Range.__repr__()
prints attributes in the same order as theRange()
arguments.Range()
arguments are no longer considered optional.
v0.21.3
Full Changelog: v0.21.2...v0.21.3
v0.21.2
Full Changelog: v0.21.1...v0.21.2
v0.21.1
Full Changelog: v0.21.0...v0.21.1