Godot: Ability to refactor variable/method names in the editor

Created on 22 Oct 2018  路  8Comments  路  Source: godotengine/godot

_Edit: This issue was reported as a duplicate of #20624_

The old issue was closed due to 'inactivity' though I think it's a much needed feature of the editor. There will probably be not much activity since there isn't much to say about it, just that we need it!

Thank you.

Godot version:

3.0.6

archived feature proposal editor usability

Most helpful comment

I totally agree with Ploppy3. This feat is very useful because it will increase productivity a lot.

Usually, in coding process, variable names and method names would be changed frequently (also true with class names and resource names).

Comparing with the Java Eclipse editor, that editor supports full renaming of methods, variables, and classes (Menu : Refactor > Rename). It even support cross class references, and that save time a lot.

I think that if GDScript editor could support that, it would be a fabulous feature.

Example Use Case:
Ex1. A public method is created. And after many other classes using the method, you decided to rename the method to better clarify the intent of the method.
Ex2. A private variable is created. And after being used internally in the class, you decided to rename it to clarify the meaning of the variable.

Thank you.

All 8 comments

Please clarify for me, witch variables? Sorry if dumb question

I guess this mean to automatically refactor rename variables, right? If that's the case this would be a duplicate of #20624, but that one is closed I have no idea why.

In that case, yes it would be a duplicate. It looks like that one was closed because no one worked to do it. I'll look into making it happen.

@neikeq is right, that's what I wanted. If you have a better idea for a title, point it out and I'll make sure to edit it.

There is something to talk about:
What exacly do you need to refactor more urgently?
Node names ? And refactor the paths in gd scripts?
Or Class variables/ mehtods? And update all instances (also in other files)

My question was originally for variables and methods. I forgot to mention the methods, I thought they were related, my bad.

Renaming in other files as well would be perfect !

I think node renaming is an other feature request https://github.com/godotengine/godot/issues/3163 which I would love to see implemented!

I totally agree with Ploppy3. This feat is very useful because it will increase productivity a lot.

Usually, in coding process, variable names and method names would be changed frequently (also true with class names and resource names).

Comparing with the Java Eclipse editor, that editor supports full renaming of methods, variables, and classes (Menu : Refactor > Rename). It even support cross class references, and that save time a lot.

I think that if GDScript editor could support that, it would be a fabulous feature.

Example Use Case:
Ex1. A public method is created. And after many other classes using the method, you decided to rename the method to better clarify the intent of the method.
Ex2. A private variable is created. And after being used internally in the class, you decided to rename it to clarify the meaning of the variable.

Thank you.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings