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

4.3 csharp files are changed on editor save causing issues in IDEs - regression? #89239

Closed
viksl opened this issue Mar 7, 2024 · 6 comments · Fixed by #89261
Closed

4.3 csharp files are changed on editor save causing issues in IDEs - regression? #89239

viksl opened this issue Mar 7, 2024 · 6 comments · Fixed by #89261

Comments

@viksl
Copy link
Contributor

viksl commented Mar 7, 2024

Tested versions

Reproducible in: 4.3 dev4 and 4.3[bfdac95]
Not reproducible: 4.2.1

System information

Windows 11 - Vulkan - Nvidia RTX 4070 - intel i5 13600KF

Issue description

Video showcasing the issue in 4.3 and comparison with 4.2.1: https://youtu.be/LFMKV9npR8U

In 4.3 for some reason saving editor when any scene is open also modifies c# files which were last modified for some reason, this causes discontinuity in how IDEs see the file since the IDEs now see that the file was modified, one such issue is in Rider when a popup dialog appears asking you if you want to reload from disk when you try to undo every time. This is increadibly annoying.

From the file itself codewise nothing changes, so maybe godot started changing some meta data or some kind of format?

I've been checking modified status in windows file explorer (also the issue with undo happening in my IDE constantly which doesn't seem to happen in 4.2.1).

Steps to reproduce

(Follow the video above for clarity or steps below)

  1. Create a C# godot project
  2. Build the project.
  3. Add any node and attach a C# script (or open the attached script through the editor in MRP).
  4. Make any changes to the file, for example add couple empty lines. (this step is necessary the IDE first needs totake the current state of the file into account).
  5. Open a file explorer and check the script file's modified status, write down/remember the date + time.
  6. Wait for a minute or more (depends on what is the minimum change your system can display, in this test I recommend a minute to make it simpler to notice the change clearly).
  7. Switch to Godot editor and pres CTRL + S (save scene/all scenes) while the scene is opened (if no scene is opened then nothing happens, if you change script A but have a scene B with a script B open then the issue still happens in the script A even though you are saving scene B).
  8. Go to the file explorer, refresh the window if you haven't (typically F5 shortcut), and observe the changed modified status.
  9. Open the script file in your IDE and observe that all the code is still the same.
    (10. This can cause issues in IDE syncing with files/undo history and I don't know what else, in my case it's undo issues in Jetbrains Rider)

Minimal reproduction project (MRP)

Test43master.zip

@paulloz
Copy link
Member

paulloz commented Mar 7, 2024

Hello. Can you share the following setting values for your editor?

  • text_editor/external/use_external_editor
  • text_editor/external/exec_path
  • text_editor/external/exec_flags
  • dotnet/editor/external_editor
  • dotnet/editor/custom_exec_path
  • dotnet/editor/custom_exec_path_args
  • dotnet/editor/editor_path_optional

I personally cannot reproduce on my end (Windows 10, Godot 4.3.dev [9b94c80], Rider 2023.3.3).

@viksl
Copy link
Contributor Author

viksl commented Mar 7, 2024

Hi, yeah definitely here it is in the same order as yours list:

  • I tried none as well as rider
  • I tried none as well as rider
  • {file} <- this is default
  • Jetbrains RIder and Fleet
  • nothing
  • {file}
  • E:\Program Files\JetBrains\JetBrains Rider 2023.2.2\bin\rider64.exe

I honestly haven't touched these settings since forever so I assume it has always been like this since I set it up.

I recorded the whole thing on a video to showcase what happens, how and comparison to 4.2.1 where it does not happen here: https://youtu.be/LFMKV9npR8U

EDIT: Sorry for weird soudns here and there, it's a health issue and the current weather has not been making it easier.

@paulloz
Copy link
Member

paulloz commented Mar 7, 2024

Thank you for the additional details 👍

@viksl
Copy link
Contributor Author

viksl commented Mar 8, 2024

No, thanks to you, I pulled the changes #89261 and it seems to be ok from a quick check.

@paulloz
Copy link
Member

paulloz commented Mar 8, 2024

Removing topic:dotnet, as it is not specific to C# scripts.

@chriztheanvill
Copy link

I having this same issue in Linux, 4.3dev-4
#89029 (comment)

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.

3 participants