Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot 4 conversion tool also converts comments. Cool, but expected? #67090

Closed
nightblade9 opened this issue Oct 8, 2022 · 6 comments
Closed

Comments

@nightblade9
Copy link
Contributor

nightblade9 commented Oct 8, 2022

Godot version

4.0 beta 2

System information

Linux, GLES3

Issue description

When converting a project, the conversion tool converts things in comments. Observe the following comments:

# Grab the Sprite and do something.
# We can fix this with yield(tween, "tween_completed")

These get converted to:

# Grab the Sprite2D and do something.
# We can fix this with await tween.finished

(There are other cases, too). While this is cool in some cases (like correcting the tween syntax), it's unexpected.

Steps to reproduce

  • Create an empty project in Godot 3.5 with a scene, a node, and a GDscript file attached to it
  • Add a bunch of comments using keywords that the conversion tool looks for
  • Close 3.5, launch 4.0 beta 2, and import the project
  • Agree to a full conversion
  • Observe the comments changed

Minimal reproduction project

No response

@Zireael07
Copy link
Contributor

The conversion tool just runs a regex. For instance, if you have scripts or nodes named the same as renamed classes, it'll rename (mess em up) too.

@nightblade9
Copy link
Contributor Author

That makes sense. I saw other things that fit that explanation (e.g. having custom change_scene methods change to change_scene_to_file.

I take it this is not a bug / not worth fixing, then?

@Zireael07
Copy link
Contributor

IIRC there is a PR open that should improve matters slightly, but I'm not certain whether it makes the tool ignore comments

@Mickeon
Copy link
Contributor

Mickeon commented Oct 8, 2022

Some things are run with a regex, others are checked more laboriously, to every maintainer's dismay because it's really difficult to handle the converter's code as is now. Your case is also handled with a regex, but I've seen some more specific function conversions that do check if the function is within a comment.

@nightblade9
Copy link
Contributor Author

I'm okay to close this as "too much effort and not worth fixing." Feel free to re-open if you think this is something that can and should be fixed in a subsequent iteration of Godot 4.

@Calinou
Copy link
Member

Calinou commented Oct 12, 2022

For future reference, this is a duplicate of #66061. #66150 will fix this issue.

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

No branches or pull requests

5 participants