It's a regex? Is it even guaranteed to work then? I would think you have to parse non-regular languages to always find the end of a function in a some languages?
Indeed, it does not always work correctly for Julia, as an arbitrary example I tried. Seems like it goes by indentation? Still nice though and worked out of the box!
When writing or updating patterns, assume that the contents these
patterns are applied to are syntactically correct. The patterns
can be simple without implementing all syntactical corner cases, as
long as they are sufficiently permissive.
It's just to match the (starting) line. I assume the +n context uses the same method diffs do anywhere else, however that works (and sometimes doesn't).