mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Fix language server thread crash
Co-Authored-By: Adam Scott <ascott.ca@gmail.com> Co-Authored-By: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
This commit is contained in:
parent
77dcf97d82
commit
8dd330dee7
2 changed files with 15 additions and 3 deletions
|
@ -112,12 +112,21 @@ void GDScriptTextDocument::didSave(const Variant &p_param) {
|
|||
}
|
||||
|
||||
scr->update_exports();
|
||||
ScriptEditor::get_singleton()->reload_scripts(true);
|
||||
ScriptEditor::get_singleton()->update_docs_from_script(scr);
|
||||
ScriptEditor::get_singleton()->trigger_live_script_reload(scr->get_path());
|
||||
|
||||
if (!Thread::is_main_thread()) {
|
||||
callable_mp(this, &GDScriptTextDocument::reload_script).call_deferred(scr);
|
||||
} else {
|
||||
reload_script(scr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GDScriptTextDocument::reload_script(Ref<GDScript> p_to_reload_script) {
|
||||
ScriptEditor::get_singleton()->reload_scripts(true);
|
||||
ScriptEditor::get_singleton()->update_docs_from_script(p_to_reload_script);
|
||||
ScriptEditor::get_singleton()->trigger_live_script_reload(p_to_reload_script->get_path());
|
||||
}
|
||||
|
||||
lsp::TextDocumentItem GDScriptTextDocument::load_document_item(const Variant &p_param) {
|
||||
lsp::TextDocumentItem doc;
|
||||
Dictionary params = p_param;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue