Skip to content

refactor: replace java-parser with tree-sitter#811

Draft
jtkiesel wants to merge 1 commit intojhipster:mainfrom
jtkiesel:refactor/tree-sitter
Draft

refactor: replace java-parser with tree-sitter#811
jtkiesel wants to merge 1 commit intojhipster:mainfrom
jtkiesel:refactor/tree-sitter

Conversation

@jtkiesel
Copy link
Contributor

@jtkiesel jtkiesel commented Mar 1, 2026

What changed with this PR:

Major refactor to replace java-parser with tree-sitter. The tree structure of the tree-sitter Java grammar more closely resembles estree's, which makes it considerably easier to port logic from Prettier's JS printer. Because the parsed tree doesn't end up with real nodes for every single production of the JLS (it seems to use "virtual" node types in many cases), the trees are much shorter/simpler, which results in noticeable performance improvements, both in formatting speed and in memory usage (~10% faster). This results in fixing #806, and also seemingly eliminating the performance issues from the addition of an embed function that was seen in #795, so ought to make that feature possible as well.

Relative issues or prs:

Closes #806

@jtkiesel jtkiesel force-pushed the refactor/tree-sitter branch 3 times, most recently from 0a8ddaf to e3b1598 Compare March 2, 2026 00:40
@jtkiesel jtkiesel force-pushed the refactor/tree-sitter branch from e3b1598 to e71d000 Compare March 2, 2026 00:50
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.

heap out of memory

1 participant