Replies: 4 comments 5 replies
-
Hi @jpienaar and thanks a lot for the feedback! In GumTree, there are 6 kinds of edit actions: insert a node, delete a node, update a node label, move a subtree, insert a subtree, and delete a subtree. Renamed identifiers (when correctly detected) are displayed with the update a node label action (displayed graphically in orange). There is no dedicated "rename" action. Still, normally most update actions are renamings (except for instance a change of comparison operator that might also be an update label). Maybe I did not understand fully the question, so don't hesitate to post a concrete example to illustrate what you would want? Cheers! |
Beta Was this translation helpful? Give feedback.
-
Thanks (and sorry I missed that you answered until now). I'm interested in a case where I have different kinds of identifiers where I'd like to not show renaming at all. E.g., for the subset of updates that are detected as renames, I'd like to not show it (my input changes some names quite often, but its not load bearing names, but I don't want to just ignore them unless rename). So as an example func.func @simple2() {
%cst1 = arith.constant 1.0 : f32
%cst2 = arith.constant 2.0 : f32
%add = arith.addf %cst1, %cst2 : f32
return
} and func.func @simple2() {
%c1 = arith.constant 1.0 : f32
%cst2 = arith.constant 2.0 : f32
%add = arith.addf %c1, %cst2 : f32
return
} are equivalent, while I'd want to flag func.func @simple2() {
%cst1 = arith.constant 1.0 : f32
%cst2 = arith.constant 2.0 : f32
%add = arith.addf %cst2, %cst1 : f32
return
} (I probably shouldn't have used floating point add as an example, but that's much higher level operation semantics than I'd expect to embedded in checking at this level :)). And so in the first case, if detected, I'd not want it to highlight the change (as the files are rather large and it could result in a lot of highlighting). Re detecting, is there a way I could see if it was detected as a rename? Perhaps in textdiff or one. |
Beta Was this translation helpful? Give feedback.
-
OK! If I understand correctly, I think one way to have the behavior you wish is to remove the label from these nodes. This way, there won't be any update action shown on them. WDYT? |
Beta Was this translation helpful? Give feedback.
-
Yes the DAG matching would still work especially if you do not remove the labels of all nodes. How to proceed, this is a good question ;-). Maybe I could add a |
Beta Was this translation helpful? Give feedback.
-
Hey,
I started trying out the tool earlier today, adding a new language using the tree-sitter approach. I was wondering if renamed identifiers are detected/could be shown differently? Currently it is shown as if renamed is updated. Well unless the tree-sitter grammar I'm using to try it out on new language isn't working correctly and these are in fact not being detected as renames, which could be happening.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions