godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
91.43k stars 21.27k forks source link

Opening resource of type "TextFile" causes error or freeze #63216

Open albinaask opened 2 years ago

albinaask commented 2 years ago

Godot version

3.4.4

System information

Windows 10, intel CPU

Issue description

When you save a text resource file and then reopen the editor and try to open it up again in the editor I get the following error message:

scene/resources/resource_format_text.cpp:804 - res://new_textfile.tres:1 - Parse Error: Expected '[' Failed to load resource 'res://new_textfile.tres'. Failed loading resource: res://new_textfile.tres. Make sure resources have been imported by opening the project in the editor at least once. scene/resources/resource_format_text.cpp:1143 - res://new_textfile.tres:1 - Parse Error: Expected '['

Steps to reproduce

  1. Open new project in godot
  2. Click create new resource of type "Text File" in file editor
  3. Edit Resource in script editor
  4. Save Resource
  5. Reload Godot
  6. Try to open beforenamed file
  7. Observe error messge

Minimal reproduction project

N/A

Calinou commented 2 years ago

Click create new resource of type "Text File" in file editor

Are you referring to the script editor or the FileSystem dock?

albinaask commented 2 years ago

I'm referring to the file system dock. ;)

allenwp commented 2 years ago

This one seemed like a weird one to reproduce, so I've gone ahead and made a recording to show exactly how to reproduce it.

https://user-images.githubusercontent.com/17506573/181276495-afd55e04-0de5-42b1-afcf-06955e5105e5.mp4

I am able to reproduce a different(?) issue where the new TextFile resource is not correctly saved the first time, but saves fine afterwards. To reproduce this issue, valid resource text must be put into the TextFile. Honestly, I'm not sure how to "correctly" use the TextFile resource, but this seems like inconsistent saving behaviour, anyway:

https://user-images.githubusercontent.com/17506573/181281218-f77c3e98-a0ee-431f-9f92-011bf387cbac.mp4

I hope that's helpful in debugging/describing the issue.

allenwp commented 2 years ago

The TextFile (.tres) resource has been removed in Godot 4, so I can't reproduce it on the alpha 12 development release. This issue is specific to Godot 3.