From 412e87349a6f1c4f8989459d7a8c7f3a028833a4 Mon Sep 17 00:00:00 2001 From: Rindbee Date: Sun, 25 Sep 2022 23:13:39 +0800 Subject: Fix out of sync when the script is edited externally via lsp Previously, external editing via lsp would modify the modified time of the script, which caused the internal display of the script to not be refreshed when refocusing the engine. Now saving the script externally via lsp will automatically refresh the internal display. --- modules/gdscript/language_server/gdscript_text_document.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'modules') diff --git a/modules/gdscript/language_server/gdscript_text_document.cpp b/modules/gdscript/language_server/gdscript_text_document.cpp index 5ad9680ea0..ccde0521f2 100644 --- a/modules/gdscript/language_server/gdscript_text_document.cpp +++ b/modules/gdscript/language_server/gdscript_text_document.cpp @@ -422,6 +422,7 @@ void GDScriptTextDocument::sync_script_content(const String &p_path, const Strin if (error == OK) { if (script->load_source_code(path) == OK) { script->reload(true); + ScriptEditor::get_singleton()->reload_scripts(true); // Refresh scripts opened in the internal editor. } } } -- cgit v1.2.3