NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #3346 most downloaded on npm
Syntax tree data structure and parser interfaces for the lezer parser
Last release 10 days ago
24 Sep 2026
Release timing varies
gaps range from 2 weeks to 12 months
Nearly every release is documented
notes for 33 of 33 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
33 releases · first in 2021
One column per quarter.
Fix an issue in mixed-language parsing that could cause the parser to waste a lot of time scanning through the same nodes repeatedly in big trees.
Fix an issue in mixed-language parsing that could cause the parser to waste a lot of time scanning through the same nodes repeatedly in big trees.
Fix a bug in mixed parsing that could cause the parser to fail to reuse unchanged inner parses.
Fix a bug in mixed parsing that could cause the parser to fail to reuse unchanged inner parses.
Fix a bug that caused SyntaxNode.enter to incorrectly enter bracketed mounted trees in some circumstances.
Fix a bug that caused SyntaxNode.enter to incorrectly enter bracketed mounted trees in some circumstances.
Nested trees can now specify that they are bracketed, and the new IterMode.EnterBracketed mode for enter will enter such trees regardless the side par
Nested trees can now specify that they are bracketed, and the new IterMode.EnterBracketed mode for enter will enter such trees regardless the side parameter.
Provide a prop method on the SyntaxNode type for more straightforward access to node props.
Provide a prop method on the SyntaxNode type for more straightforward access to node props.
Fix an issue where in some situations a nested parse would break highlighting after it.
Fix an issue where in some situations a nested parse would break highlighting after it.
Node props may now define a merge function that will be used when the prop is added to a node that already has it.
Fix an issue in TreeCursor.iterate that made it iterate through siblings of the current node.
Fix an issue in TreeCursor.iterate that made it iterate through siblings of the current node.
Fix a bug in TreeCursor.matchContext where, if the context fell partially in a buffer node and partially in tree nodes, it could return incorrect resu
Fix a bug in TreeCursor.matchContext where, if the context fell partially in a buffer node and partially in tree nodes, it could return incorrect results.
Fix a bug where getChild and getChildren would, if the first and second arguments matched the same node, return incorrect results.
Fix a bug where getChild and getChildren would, if the first and second arguments matched the same node, return incorrect results.
The new NodeProp.isolate can be used by parser to signal that a given node should be treated as isolated when it comes to bidirectional text rendering
The new NodeProp.isolate can be used by parser to signal that a given node should be treated as isolated when it comes to bidirectional text rendering.
Fix a crash that could happen in mixed-language parsing when mounting a tree to a zero-length node.
Fix a crash that could happen in mixed-language parsing when mounting a tree to a zero-length node.
Fix a bug where resolveStack could sometimes yield the same node multiple times.
Fix a bug where resolveStack could sometimes yield the same node multiple times.
Allow mixed-parsing trees to be mounted for zero-length nodes.
Fix a bug in mixed-language parsing that could some parts of an inner language to be missed when incrementally reparsing from a stopped parse.
In Tree.build, when given an extremely deeply nested tree structure, flatten it instead of overflowing the stack.
The new Tree.resolveStack method returns an iterator through the nodes covering a position, including those from overlays not active at that point.
The new Tree.resolveStack method returns an iterator through the nodes covering a position, including those from overlays not active at that point.
Make the package usable in TypeScript with node16/nodenext resolution.
Make the package usable in TypeScript with node16/nodenext resolution.
Tree.iterate now properly includes anonymous nodes when IterMode.IncludeAnonymous is enabled.
Tree.iterate now properly includes anonymous nodes when IterMode.IncludeAnonymous is enabled.
Fix a bug in mixed parsing that would sometimes produce invalid trees.
Fix a bug in mixed parsing that would sometimes produce invalid trees.
Fix a bug that could cause incremental parsing to incorrectly reuse nodes inside nested mixed parses.
Fix a bug that could cause incremental parsing to incorrectly reuse nodes inside nested mixed parses.
### New features First stable version.
First stable version.
Declare matchContext as a property of SyntaxNodeRef.
Declare matchContext as a property of SyntaxNodeRef.
The mixed parsing interface now passes SyntaxNodeRef values instead of TreeCursor instances around.
The mixed parsing interface now passes SyntaxNodeRef values instead of TreeCursor instances around.
Creating a cursor at a given position is now done with Tree.cursorAt, not cursor.
Getting a cursor from a syntax node is now done with a method (cursor) rather than a getter.
Tree.fullCursor was removed and replaced by the IncludeAnonymous iteration mode.
The optional arguments to enter tree traversal methods were replaced with a single mode argument.
Tree.iterate now passes node objects, rather than type/from/to as separate arguments, to its callback functions.
The new SyntaxNodeRef type provides an interface shared by SyntaxNode and TreeCursor.
TreeCursor instances now how have an iterate method that calls a function for each descendant of the current node.
The new matchContext method on SyntaxNode and TreeCursor provides a convenient way to match the names of direct parent nodes.
Cursors can now be passed flags to control their behavior.
Work around a TypeScript issue that caused it to infer return type any for resolve and resolveInner.
Work around a TypeScript issue that caused it to infer return type any for resolve and resolveInner.
Fix a bug in incremental mixed-language parsing where it could incorrectly add a parse range twice, causing a crash in the inner parser.
Fix a bug where nested parsing would sometimes corrupt the length of parent nodes around the nesting point.
Fix a bug where nested parsing would sometimes corrupt the length of parent nodes around the nesting point.
SyntaxNode now has a resolveInner method (analogous to Tree.resolveInner).
SyntaxNode now has a resolveInner method (analogous to Tree.resolveInner).
Full tree cursors no longer automatically enter mounted subtrees.
Full tree cursors no longer automatically enter mounted subtrees.
Fix a bug where a nested parser would not re-parse inner sections when given fragments produced by a parse that finished the outer tree but was stopped before the inner trees were done.
Fix a bug that could cause incorrectly structured nodes to be created for repeat rules, breaking incremental parsing using the resulting tree.
Fix a bug that could cause incorrectly structured nodes to be created for repeat rules, breaking incremental parsing using the resulting tree.
Fix an issue in parseMixed where parses nested two or more levels deep would use the wrong document offsets.
Fix an issue in parseMixed where parses nested two or more levels deep would use the wrong document offsets.
Fix a null-dereference crash in mixed-language parsing.
Fix a null-dereference crash in mixed-language parsing.
Syntax node objects now have a method enterUnfinishedNodesBefore to scan down the tree for nodes that were broken off directly in front of a given pos
Syntax node objects now have a method enterUnfinishedNodesBefore to scan down the tree for nodes that were broken off directly in front of a given position (which can provide a more accurate context that just resolving the position).
parseMixed will now scan children not covered by the ranges of an eagerly computed overlay for further nesting.
parseMixed will now scan children not covered by the ranges of an eagerly computed overlay for further nesting.
Fix an issue where parseMixed could create overlay mounts with zero ranges, which were useless and confused CodeMirror's highlighter.
Fix an issue where parseMixed could create overlay mounts with zero ranges, which were useless and confused CodeMirror's highlighter.
Fix a bug that would cause enter to return incorrect results when called entering children in a buffer with .
Fix a bug that would cause enter to return incorrect results when called entering children in a buffer with .
Fix a bug where parseMixed could crash by dereferencing null.
Fix a bug where parseMixed could crash by dereferencing null.
The module name has changed from lezer-tree to @lezer/common.
The module name has changed from lezer-tree to @lezer/common.
TreeBuffers no longer accept a node type.
Tree.balance no longer takes a buffer size as argument.
NodeProp.string, NodeProp.number, and NodeProp.flag have been removed (the thing they provided is trivial to write by hand).
A node's context hash is now stored in the NodeProp.contextHash prop.
Reused nodes passed to Tree.build must now be Tree instances (not tree buffers).
Parser is now an abstract class that all parser implementations must extend, implementing the createParse method.
The PartialParse interface changed to make multi-pass parsers possible.
Parser.startParse now takes different arguments (input, fragments, ranges) instead of (input, startPos, context).
The Input interface has changed (to become chunk-based and more low-level). A single Input object is now shared between outer and inner parses.
stringInput is no longer exported (Parser methods will automatically wrap strings when appropriate).
Fix a bug in TreeFragment.applyChanges that prevented some valid reuse of syntax nodes.
Fix a bug where reused nodes could incorrectly be dropped by Tree.build.
Node props can now be per-node, in which case they are stored on Tree instances rather than NodeTypes.
Tree nodes can now be replaced with other trees through NodeProp.mountedTree.
Tree.resolveInner can now be used to resolve into overlay trees.
SyntaxNode objects now have a toTree method to convert them to a stand-alone tree.
Tree.balance now accepts a helper function to create the inner nodes.
Tree cursors' next/prev methods now take an enter argument to control whether they enter the current node.
SyntaxNode and TreeCursor now have an enter method to directly enter the child at the given position (if any).
Tree.iterate callbacks now get an extra argument that allows them to create a SyntaxNode for the current node.
The parsing interface now supports parsing specific, non-contiguous ranges of the input in a single parse.
The module now exports a parseMixed helper function for creating mixed-language parsers.
Your coding agent can read these notes before it upgrades. Set up the MCP server →