Skip to content

The target node information is not available in update operation #3

Description

@mohayemin

I have a use case where I need the information of the target nodes in the EditScript. However, only the target node text is passed to the Update objects. For example the code at code_diff/__init__.py:L200 is

if source_ast.type == target_ast.type and len(source_ast.children) == 0 and len(target_ast.children) == 0:
  # Both nodes are tokens of the same type 
  # Only an update is required
  return EditScript([Update(source_ast, target_ast.text)])

I suggest that the last line to be replaced with:

return EditScript([Update(source_ast, target_ast)])

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions