Skip to content

Releases: Faveod/ruby-tree-sitter

v2.1.0

19 Feb 15:38

Choose a tag to compare

API Changes for tree-sitter 0.26 compatibility

  • Updated to tree-sitter v0.26.5
  • Breaking Changes in tree-sitter 0.26.x API:
    • ts_language_version renamed to ts_language_abi_version
    • TSInputEncodingUTF16 split into TSInputEncodingUTF16LE and TSInputEncodingUTF16BE
      (now using UTF16LE as default for backward compatibility)
    • Cancellation flag API (ts_parser_cancellation_flag, ts_parser_set_cancellation_flag) removed
      • Parser#cancellation_flag and Parser#cancellation_flag= are now no-ops for backward compatibility
    • Timeout API (ts_parser_timeout_micros, ts_parser_set_timeout_micros) removed
      • Parser#timeout_micros and Parser#timeout_micros= are now no-ops for backward compatibility
    • Use TSParseOptions with progress_callback for cancellation/timeout functionality in 0.26+
  • TREE_SITTER_LANGUAGE_VERSION is now 15 (was 14)
  • TREE_SITTER_MIN_COMPATIBLE_LANGUAGE_VERSION is now 13 (was 6)
  • Grammar files (.so) must be built against tree-sitter 0.26+ to work with this version

Bug Fixes

  • Fixed duplicate method definition in QueryCursor (#100 by yancya)
  • Fixed a use-after-free in the logger (#100 by yancya)
  • Fixed a potential buffer overflow when loading parsers.

v2.0.0

22 Jan 13:59

Choose a tag to compare

  • Removed support for ruby 3.0.

v1.12.0

15 Jan 15:34

Choose a tag to compare

  • Use tree-sitter v0.24.7.
  • Fix Oppen version requirement in gemspec.

v1.11.1

02 Jan 16:19

Choose a tag to compare

Disregard v1.11.0. It had 2 major issues:

  1. It doesn't provide a precompiled version for ruby 3.3
  2. It claims it works with tree-sitter 0.24.6 but it was running on 0.24.5

v1.11.0

02 Jan 13:18

Choose a tag to compare

  • Use tree-sitter v0.24.6.
  • Added new rbts executable to aide with writing tree-sitter query's. It will watch a source & query file then print the match & capture nodes to the screen. See rbts --help for more details.
  • TreeSitter: better erorr message in Node#[].
  • Cross-Compile:
    • build native ruby 3.4 gems.
    • restore cross-compilation tests.
  • TreeSitter|TreeStand: add Node#sexpr. It's a better alternative to
    tree-sitter's native ts_node_string which can always be reached via
    Node#to_s or Node#to_string. For instance, for the expression 1 + x * 3,
    ts_node_string always prints:
      (expression (sum left: (number) right: (product left: (variable) right: (number))))
    
    Node#sexpr is still capable of doing the same, but if we do
    node.sexpr(width: 40) we get:
      (expression
        (sum
          left: (number)
          (+)
          right:
            (product
              left: (variable)
              (*)
            right: (number))))"
    
    We can even print the named leaf nodes:
      (expression           |
        (sum                |
          left:             |
            (number)        | 1
          (+)               | +
          right:            |
            (product        |
              left:         |
                (variable)  | x
              (*)           | *
              right:        |
                (number)))) | 3
    

v1.10.0

10 Dec 16:26

Choose a tag to compare

  • Make TreeSitter::TreeSitterError < Exception instead of StandardErorr;
    we don't want them to be handled by default rescue.

v1.9.1

05 Dec 15:35

Choose a tag to compare

  • Add custom errors for language loading:
    - LanguageLoadError
    - ParserNotFoundError
    - ParserVersionError
    - SymbolNotFoundError
  • Add custom QueryCreationError for query creation.

v1.9.0

21 Nov 10:06

Choose a tag to compare

What's Changed

  • Bump tree-sitter to 0.24.4

v1.8.0

06 Nov 12:36

Choose a tag to compare

What's Changed

  • Bump tree-sitter to 0.24.3

v1.7.0

16 Sep 14:34

Choose a tag to compare

Use tree-sitter v0.23.0.