Skip to content

fix(cli): cst printing improvements - #5161

Merged
clason merged 2 commits into
tree-sitter:masterfrom
arkriny:fix/cst-improvements
Dec 24, 2025
Merged

fix(cli): cst printing improvements#5161
clason merged 2 commits into
tree-sitter:masterfrom
arkriny:fix/cst-improvements

Conversation

@arkriny

@arkriny arkriny commented Dec 23, 2025

Copy link
Copy Markdown
Contributor

Fixes extra prefix whitespaces with --no-ranges flag.
Removes the trailing newline to make CST output consistent with other formats.

See commit messages for details.

Comparison before/after:

tree-sitter-rust $ ts parse --cst --no-ranges test.rs
  source_file
    type_item
      "type"
      name: type_identifier `A`
      "="
      type: tuple_type
        "("
        primitive_type `i32`
        ","
        type_identifier `String`
        ")"
      ";"

tree-sitter-rust $ ts parse --cst --no-ranges test.rs
source_file
  type_item
    "type"
    name: type_identifier `A`
    "="
    type: tuple_type
      "("
      primitive_type `i32`
      ","
      type_identifier `String`
      ")"
    ";"
tree-sitter-rust $

@arkriny
arkriny force-pushed the fix/cst-improvements branch from 4a90b28 to f05e57e Compare December 23, 2025 13:27
@clason
clason merged commit f96d518 into tree-sitter:master Dec 24, 2025
23 checks passed
@tree-sitter-ci-bot

Copy link
Copy Markdown

Successfully created backport PR for release-0.26:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants