godotengine / godot

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

Script editor opens script on crash when using external editor #89203

Open Morokiane opened 8 months ago

Morokiane commented 8 months ago

Tested versions

4.2.1.stable

System information

MacOS and Windows 11

Issue description

When using an external editor such as VSCode, if the game crashes from debug, Godot will open the script in the Script Editor. This will sometimes cause an issue where if the code is changed in VSCode, Godot will revert it to a previous state when the game is ran again.

Steps to reproduce

Make a mistake in an external editor and run the game. After the crash, the script will be opened in the internal Godot editor. It is very inconsistent, and I'm not sure how to get it to revert the code to a previous state after a change in the external editor and ran again.

Minimal reproduction project (MRP)

Any project should work with external editor configured.

Morokiane commented 8 months ago

Another way this happens is if a script is opened in the internal editor (like from a crash) and the same script is edited in the external editor. If you then connect a signal through the node tab, it will add the connect code into the script and overwrite the external version with the older version opened in the script editor.

jedomed commented 7 months ago

I have the same problem, every time I get an error I have to switch to the Script tab and close all files, otherwise the version from the script editor keeps overwritting my changes in VS Code (probably because of VS Code's auto-reload that can't be turned off...) I'm guessing it's the same issue as here https://github.com/godotengine/godot/pull/89523 ?

clorl commented 6 months ago

I concur, this is a real issue

Morokiane commented 5 months ago

This is still an issue with 4.3 beta 1