Skip to content

Add "refactor" tooling to rename symbols in the script editor #899

@Zireael07

Description

@Zireael07

Describe the project you are working on:
N/A (generic issue)
Describe the problem or limitation you are having in your project:
Renaming a variable in a script causes references to it in other script to be broken.

Describe the feature / enhancement and how it helps to overcome the problem or limitation:
When renaming a variable, it should refactor/rename references too.

Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:
Quoted from original issue:
When renaming any kind of object in Godot, it should find all occurrences in scripts/editor
and change that as well. This can be achieved by parsing script files, any matching names for the changed scene/node, like "load(), preload(), set_script() get_node()..etc!) functions.

This should apply too to renaming variables, it would be great if when renaming a variable in script
it changes all occurrences in the script file.

If this enhancement will not be used often, can it be worked around with a few lines of script?:
Nope. (Also I assume it will be used more often the bigger and more complex projects are)

Is there a reason why this should be core and not an add-on in the asset library?:
Has to be done in script editor for variables use case, and in the editor itself (possibly Fix Dependencies dialog) for other use case.

Original issue: godotengine/godot#3163

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions