Skip to content

[Question] Error when running demo/find_replace_custom_cleanup_demos.py #707

Description

@sasidv

Hi Team,

I'm trying to run the find_replace_custom_cleanup_demos.py file as the first step in getting started with Polyglot Piranha, but I encountered the following error when executing the python_demo() function.

thread '<unnamed>' panicked at src/utilities/tree_sitter_utilities.rs:191:3:
Could not fetch range or node for replace_node @assignment. Context: ["i", "list", "assignment"]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/Users/xxx/Documents/TreeSitter/TreeSitter/src/demo/find_replace_custom_cleanup_demos.py", line 80, in <module>
    python_demo()
  File "/Users/xxx/Documents/TreeSitter/TreeSitter/src/demo/find_replace_custom_cleanup_demos.py", line 67, in python_demo
    _ = execute_piranha(args)
pyo3_runtime.PanicException: Could not fetch range or node for replace_node @assignment. Context: ["i", "list", "assignment"]

However, I also noticed that when I remove the following entry from the only_lists.py file, the error disappears. Does anyone have any idea why this might be happening?

    deps3 = ['dependency2']

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions