Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice (simple) introduction to the tree sitter APIs.

If you're looking for a higher level interface, GritQL[0] is built on top of tree-sitter and could handle the same refactor with this query:

  language python

  `def $_($_): $_` as $func where $func <: contains `database` => `db`

[0] https://github.com/getgrit/gritql


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: