Recoder icon indicating copy to clipboard operation
Recoder copied to clipboard

Issue with getNodeId

Open thanhlecongg opened this issue 1 year ago • 0 comments

Hi,

I found that when you identify the root node in this line, you have ignored IfStatement and ForStatement. I guess your purpose is to traverse its children. But, how about other statements which also have children? For example, WhileStatement or BlockStatement also has children.

Particularly, I observed several cases in which the root node is BlockStatement. In such cases, your implementation returns the BlockStatement as the root node. As a result, the sub root in this line cannot be found as BlockStatement do not belong to linenode, making Recorder produce nothing.

This problem can be addressed by adding the condition of root.name != 'BlockStatement' to this line but I am not sure if it is in your intention or not. Thanks

thanhlecongg avatar Aug 01 '23 04:08 thanhlecongg