Tree-sitter, a fast incremental code parsing generator, now has an R grammar that unlocks a rich ecosystem of developer tools for R. This includes improved GitHub code search, autocompletion in the Positron IDE via the Ark kernel, the Air code formatter, the Jarl linter, ast-grep-based refactoring via {flir}, mutation testing with {muttest}, and structural diffs with difftastic. The R grammar file by Davis Vaughan is the foundation enabling all these tools, which benefit from Tree-sitter's speed, incremental parsing, and language-agnostic design. Both R packages (treesitter, astgrepr) and Rust-based CLIs (Air, Jarl) are part of this growing ecosystem.

7m read timeFrom ropensci.org
Post cover image
Table of contents
🔗 Code parsing: what is Tree-sitter?🔗 Browsing code interactively: Positron IDE, GitHub🔗 Searching/browsing code🔗 Formatting and linting: Air, Jarl🔗 More tools🔗 Conclusion: more to come?

Sort: