Get the latest tech news
Refactoring Python with Tree-sitter and Jedi
I was toying around with a refactor the other day that would have taken me ages by hand as it involved 100s of files. I wanted to rename every instance of...
I wanted to rename every instance of a pytest fixture from database-> db across my entire repo (silly I know). After struggling to achieve what I wanted with the tools I'd typically reach for ( grep+ sed) I decided to try something a bit fancier. I found both jedi and tree-sitter relatively easy to learn, I'll certainly be keeping them in my toolbelt for situations where grep+ sed don't quite cut it.
Or read this on Hacker News