3 ms·
Seems to be the best choice since treesitter is already generic and supports many languages. Will try this out first.
by sureglymop 2y ago
Seems to be the best choice since treesitter is already generic and supports many languages. Will try this out first.
- emporas 2y agotree-sitter is very generic and supports so many languages, it is really great. The first use case of the article, "Level 1: Irrelevant Whitespace" is covered by diffsitter. I wanted at some point, to diff files and ignore comments for Rust source code. I wrote a small program, to remove the two different comment nodes the Rust grammar defines: line_comments and block_comments. Then i diffed the resulting uncommented code using diffsitter. From start to finish, writing the program and testing it to many different files it took 5 hours.