-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Fix script overwriting with external editor #96007
Fix script overwriting with external editor #96007
Conversation
Will this reload also solve resource desyncs between the external editor and internal one? |
This should only affect script resources, they will be synced. Other resources should behave the same. Is there an issue for non-script resource desyncs? |
No, i was just talking about script desyncs. Thank you for fixing it! |
This should fix #94080. |
Thanks! |
Cherry-picked for 4.3.1. |
Does this fix #82266 as well? |
Since you've been looking into it, the easiest way to confirm would be for you to test https://godotengine.org/article/dev-snapshot-godot-4-4-dev-2/ which includes this fix. |
@akien-mga I just tested the steps to reproduce the bug with 4.4-dev2 and I can confirm that it's fixed. #82266 can be closed as well. |
#82956 does not fix the crash in #71016 if the external editor setting is turned off.
Basically this undoes #82956 and has an alternate fix for #71016.
#71016 happens because
ScriptEditor::_reload_scripts
it is called from a thread, and it is not safe to do so.ERR_MAIN_THREAD_GUARD
won't work here sinceGDScriptLanguageServer::thread_main
setsset_current_thread_safe_for_nodes
totrue
, even though its not really thread safe.For instance, the crash is potentially caused by
GDScriptSyntaxHighlighter::_get_line_syntax_highlighting_impl
being called fromTextEdit
's draw in the main thread, whileScriptEditor::reload_scripts
callsScriptTextEditor::reload_text()
,ScriptTextEditor::_validate_script()
, thenGDScriptSyntaxHighlighter::_update_cache
, which changes things while it is trying to be drawn.