Skip to content
Tech News
← Back to articles

A Better R Programming Experience Thanks to Tree-sitter

read original get Tree-sitter for R → more articles
Why This Matters

The integration of Tree-sitter into R development tools significantly enhances the coding experience by enabling more accurate parsing, auto-completion, and code navigation. This advancement benefits both developers and consumers by making R programming more efficient and user-friendly, fostering better productivity and code quality in the industry.

Key Takeaways

A little bit less than two years ago, building on work by Jim Hester and Kevin Ushey, Davis Vaughan completed a very impactful JavaScript file for the R community: an R grammar for the Tree-sitter parsing generator. He even got a round of applause for it during a talk at the useR! 2024 conference! So, did he get cheered for… grammatical rules in a JavaScript file? 😅

No, the audience was excited about the improved developer experience for R that this file unlocked. R tooling around Tree-sitter is how you get

reformatting through Air and linting through Jarl;

auto-completion or help on hover in the Positron IDE;

better search for R on GitHub;

and more!

In this post, we’ll explain what Tree-sitter is, and how tools built on Tree-sitter can benefit your R development workflow.

🔗 Code parsing: what is Tree-sitter?

Tree-sitter is a code parsing generator written in C, with bindings existing in several languages including Rust (and R!).

Let’s rewind a little bit. What does it mean to parse code?

... continue reading