-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Prevent renaming to an unkown extension from FileSystem dock. #56847
Conversation
I noticed that EditorFileSystem has a list of valid extensions. Maybe we could add a method to retrieve it, so it can be reused? |
276959a
to
7d4965d
Compare
I've added a method : The function is not exposed to GDScript. Don't know if it will be very usefull (plugins ?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. The message might need tweaking though, CC @Calinou
As the list is updated in scan(), I'm not sure if we need to check if valid_extension is not empty and if empty, call _update_extensions().
AFAIK editor automatically scans on startup, so this is not a problem.
The function is not exposed to GDScript. Don't know if it will be very usefull (plugins ?)
No need to expose it for now.
7d4965d
to
c24433f
Compare
Thanks! |
Cherry-picked for 3.5. |
Cherry-picked for 3.4.3. |
Fixes #56805
Issue description
Renaming a file in FileSystem dock to an unrecognized extension hides the file in editor.
No warning. Just a file that disapears. Can't be undone from editor FileSystem dock.
Fix proposal
Prevent doing such a thing because it is probably a mistake and it can't be undone from the editor which may be quite misleading.
Instead of renaming, show a warning explaining the situation.
Invite user to use system file explorer to do such a rename on purpose.
As english is not my native language, you are invited to provide me a better message if you think it's needed.