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

Fixes internal Script Editor crash with External Editor active #82956

Merged

Conversation

Chtau
Copy link
Contributor

@Chtau Chtau commented Oct 7, 2023

Prevent the internal Script Editor from reloading when the external Editor is active in the settings.

This prevents a crash from different race conditions from editing files in the external editor while the internal editor tries to reload open file tabs.

Some conditions that cause the crash where:

  • Syntax highlighting (gdscript_highlighter.cpp, syntax_highlighter.cpp)
  • Code analysis (code_edit.cpp)
  • ... and more

Info:
The script tabs on the internal Editor should probably be closed in the check but this is not relevant for this problem (engine crash) and more changes are required for it because the trigger is not on the main thread.

This solves the crashes mentioned in #71016
I was able to reproduce the different crashes as mentioned in #71016 (comment)

@Chtau Chtau requested a review from a team as a code owner October 7, 2023 11:20
@AThousandShips AThousandShips changed the title Internal Script Editor crashes Engine with External Editor active Fixes internal Script Editor crash with External Editor active Oct 7, 2023
@AThousandShips AThousandShips added this to the 4.2 milestone Oct 7, 2023
Copy link
Contributor

@ryanabx ryanabx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see no problems with this.

@akien-mga
Copy link
Member

Looks good! Could you squash the commits? See PR workflow for instructions.

when the external Editor is active in the settings.

This prevents a crash from different race conditions
from edititing files in the external editor while the internal editor
tries to reload open file tabs.

Some conditions that cause the crash where:
* Syntax highlighting (gdscript_highlighter.cpp, syntax_highlighter.cpp)
* Code analysis (code_edit.cpp)
* ... and more
@Chtau Chtau force-pushed the GDScript-external-Editor-Engine-crash branch from b1a3c9b to 2929993 Compare October 11, 2023 19:41
@adamscott adamscott self-requested a review October 17, 2023 13:54
Copy link
Member

@adamscott adamscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine. Could be merged for the next beta!

@akien-mga It seems that the PR is now squashed. :)

@akien-mga akien-mga merged commit 38c3e5a into godotengine:master Nov 10, 2023
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

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

Successfully merging this pull request may close these issues.

Crash while editing GDScript in VS Code via LSP
5 participants