Skip to content

v4.3.14

Choose a tag to compare

@aovestdipaperino aovestdipaperino released this 11 May 13:43
· 240 commits to master since this release

Fixed

  • tokensave_body no longer drops the function's outer closing brace (#62) — stored line fields are tree-sitter rows (0-based) but extract_lines treated them as 1-based inclusive, so the slice was lines[start..end_line] exclusive — one line short, lopping off the trailing }. Inner braces were unaffected because they were never on the boundary. extract_lines now slices inclusively over 0-based row indices, so the returned body is byte-exact usable as an Edit tool old_string.

Changed

  • tokensave_body now exposes start_line / end_line as 1-based file line numbers — they were the raw 0-based tree-sitter row indices, which read as "off by one" against the line numbers any editor or Edit-style tool displays. The values now match what users see when they open the file, so the reported end_line is the line containing the function's closing brace. The shift is local to handle_body; other handlers still expose node.start_line as-is.