From discussion #19 by @yunfan.
Stacklit already parses codebases with tree-sitter and builds dependency graphs. The next logical step is using those same parsed trees for structured code editing, locating a node by its tree-sitter path and replacing it with generated code.
What this could look like:
- Target a specific function/type/export by its tree-sitter path
- Replace or patch that node while preserving surrounding code
- Use stacklit's dependency graph to find cross-file call sites that need updating
Open questions:
- Tree-sitter gives syntax, not semantics. Cross-file renames need the dependency layer too.
- How to handle edits that change the tree structure (adding params, changing return types)
- Could work as a separate companion tool that reads stacklit.json for the graph
No timeline. Scoping for now.
From discussion #19 by @yunfan.
Stacklit already parses codebases with tree-sitter and builds dependency graphs. The next logical step is using those same parsed trees for structured code editing, locating a node by its tree-sitter path and replacing it with generated code.
What this could look like:
Open questions:
No timeline. Scoping for now.