Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

Tree-sitter solved parsing. It powers syntax highlighting and code navigation at GitHub, drives the editing experience in Zed, Helix, and Neovim. It gives you a fast, accurate, incremental syntax tree for virtually any language.

The hard problem now is what comes _after_ parsing, extraction of meaning from the tree:
The hard problem now is what comes _after_ parsing: extraction of meaning from the tree, and safe transformation back to source:

```typescript
function extractFunction(node: SyntaxNode): FunctionInfo | null {
Expand All @@ -56,7 +56,7 @@ function extractFunction(node: SyntaxNode): FunctionInfo | null {
}
```

Every extraction requires a new function, each one a potential source of bugs that won't surface until production.
Every extraction requires a new function, each one a potential source of bugs that won't surface until production. And once you've extracted what you need, applying changes back to the source requires careful span tracking, validation, and error handling—another layer of brittle code.

## The solution

Expand All @@ -80,6 +80,8 @@ interface FunctionInfo {

This structure is guaranteed by the query engine. No defensive programming needed.

Once extraction is complete, Plotnik will support **transactions** to apply validated changes back to the source. The same typed nodes used for extraction become targets for transformation—completing the loop from source to structured data and back to source.

## But what about Tree-sitter queries?

Tree-sitter already has queries:
Expand Down