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

C# Selecting an error makes a "Save Resource As" menu appears when running the project #76415

Closed
XenokNyx opened this issue Apr 24, 2023 · 4 comments · Fixed by #79280
Closed

Comments

@XenokNyx
Copy link

XenokNyx commented Apr 24, 2023

Godot version

4.0.2

System information

Windows 10

Issue description

If an error in the Debugger/Errors menu caused by a C# script is selected every time the project is executed a "Save Resource As" menu appears.
Erro1
Erro2

The only way to stop it for appearing is restarting Godot.

Steps to reproduce

  1. Execute a C# script with an error
  2. Select the error in the Debugger/Errors menu
  3. Click "run project"
  4. A "Save Resource As" menu appears.

Minimal reproduction project

Example code with error:

using Godot;
using System;

public partial class ErrorTest : Node 
{
    public override void _Ready() 
    {
        Node nullNode = null;

        nullNode.ToString();
    }
}
@Calinou
Copy link
Member

Calinou commented Jun 9, 2023

Does this occur with errors that are caused by a GDScript file in a Mono build?

@XenokNyx
Copy link
Author

XenokNyx commented Jul 2, 2023

C# Only, at least with the test I have done the error in GDScript appear in "Debugger/Stack Trace" while the error in C# appears in "Debugger/Errors" thats where the problem take place.

@raulsntos
Copy link
Member

I'm unable to reproduce this issue, could you upload a minimal reproduction project? Also, a few questions to try and better understand the issue:

  • Does this happen on every C# project?
  • Do you have a custom editor configured in Editor Settings (either in Editor Settings > Dotnet > Editor or in Editor Settings > Text Editor > External)?
  • Do you have any open scripts in Godot's code editor? Manually switch to the Script view by using the button in the top middle of the Godot editor (right next to 2D, 3D and AssetLib) and look at the left sidebar that shows the list of open scripts.

Clicking on the errors in the Debugger's Error panel should open the script in your configured editor. When running the project, Godot saves every open resource (like scenes and scripts). So it's possible that clicking on an error opened an invalid script or the script was deleted afterwards, and then running the project will ask you to save it.

@XenokNyx
Copy link
Author

XenokNyx commented Jul 4, 2023

It does happen in every C# project I have, here is the project I used for the test it's just an empty project with the script that produce the error (4.1 rc2, but it happen in previous versions too).
TESTS.zip

There is nothing else open, only the main scene and the only modified setting is the external editor as Visual Studio Code.

Here is a video recreating the error.
https://github.com/godotengine/godot/assets/6534007/913055ba-6825-44b2-b8e7-19e62f890808

Clicking on the errors in the Debugger's Error panel should open the script in your configured editor. When running the project, Godot saves every open resource (like scenes and scripts). So it's possible that clicking on an error opened an invalid script or the script was deleted afterwards, and then running the project will ask you to save it.

I have Visual Studio Code configured as an external editor, expanding the error details and clicking one of those lines does open the editor without any error only clicking on the red text produces the error.

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

Successfully merging a pull request may close this issue.

4 participants