summaryrefslogtreecommitdiff
path: root/modules/gdscript/language_server
diff options
context:
space:
mode:
authorRindbee <idleman@yeah.net>2022-09-25 23:13:39 +0800
committerRindbee <idleman@yeah.net>2022-09-25 23:30:35 +0800
commit412e87349a6f1c4f8989459d7a8c7f3a028833a4 (patch)
tree9dfecf593edb43ce8b066243f038b36591b82ac2 /modules/gdscript/language_server
parent15ac442247b2b45ae0e2900d18f26e5b82e6c011 (diff)
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.
Diffstat (limited to 'modules/gdscript/language_server')
-rw-r--r--modules/gdscript/language_server/gdscript_text_document.cpp1
1 files changed, 1 insertions, 0 deletions
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.
}
}
}