Skip to content

fix(cli): cst printing improvements#5161

Merged
clason merged 2 commits intotree-sitter:masterfrom
skewb1k:fix/cst-improvements
Dec 24, 2025
Merged

fix(cli): cst printing improvements#5161
clason merged 2 commits intotree-sitter:masterfrom
skewb1k:fix/cst-improvements

Conversation

@skewb1k
Copy link
Contributor

@skewb1k skewb1k commented Dec 23, 2025

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 $

@skewb1k skewb1k 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

Successfully created backport PR for release-0.26:

@skewb1k skewb1k deleted the fix/cst-improvements branch December 24, 2025 16: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