Wilfred / difftastic

a structural diff that understands syntax 🟥🟩
https://difftastic.wilfred.me.uk/
MIT License
20.69k stars 339 forks source link

Show function name in hunk header #304

Open jrmuizel opened 2 years ago

jrmuizel commented 2 years ago

GNU diff with -p will include the name of the function in the hunk header. I find this really useful for understanding the context of the diff and it would be great if difftastic could do it too.

sesse commented 2 years ago

git diff also does this by default, and I really miss it in difftastic! Maybe with tree-sitter, it will be possible to get the cases right that the others don't, e.g.:

@@ -253,14 +299,9 @@ template <typename CharacterType>

But when it works, it's great:

@@ -199,14 +250,9 @@ static CSSPropertyID UnresolvedCSSPropertyID(

frankitox commented 4 months ago

I see a PR merged in 2023, but this is not supported yet right? At least with version 0.58.0 I don't see a -p or --show-c-function flag.