tree-sitter-python
tree-sitter-python copied to clipboard
Regular expressions in raw strings aren't formatted
trafficstars
Example formatted by MagicPython:

/cc @queerviolet - Now we can handle this by injecting tree-sitter-regex into raw strings. We'll have to identify the strings' raw-ness from the text, by checking if the string starts with an r, fr, or br.
I'm not sure how specific we want to be about our injection. Maybe we just start by doing it in all raw strings?
You can write a query like https://github.com/nvim-treesitter/nvim-treesitter/blob/9e147d23566f58f2da6682242ffb89cb0de426b5/queries/python/injections.scm#L1-L6 to match nodes that contain a regex