Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 6, 2026

Summary

  • Rename tree command to ast for showing AST of both query and source files
  • Show Plotnik query AST when query input is provided (.ptk files or -q)
  • Show tree-sitter source AST when source input is provided
  • Show both (with headers) when both query and source are provided
  • Add unified flags: all commands accept --raw (hidden where not applicable)

Why

The tree command only showed tree-sitter AST of source files. When debugging queries, you often need to see the query's own AST structure. This unifies both into a single ast command that follows the same input pattern as exec/trace, so you can seamlessly switch between commands without changing arguments.

Notes

  • Reuses run_common::load_source and run_common::resolve_lang instead of duplicating
  • Removes --spans flag (only --raw kept for simplicity)

@zharinov zharinov enabled auto-merge (squash) January 6, 2026 00:37
@zharinov zharinov merged commit e9bc239 into master Jan 6, 2026
4 checks passed
@zharinov zharinov deleted the feat/ast-command branch January 6, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants