From a6410878db26517213c7d7750ecc70bf82173941 Mon Sep 17 00:00:00 2001 From: rune-scape Date: Sun, 20 Nov 2022 03:17:16 -0500 Subject: [PATCH] Fix empty text in editor --- modules/gdscript/gdscript_cache.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/gdscript/gdscript_cache.cpp b/modules/gdscript/gdscript_cache.cpp index 40681d97719..00ae5f43c50 100644 --- a/modules/gdscript/gdscript_cache.cpp +++ b/modules/gdscript/gdscript_cache.cpp @@ -236,15 +236,16 @@ Ref GDScriptCache::get_shallow_script(const String &p_path, Error &r_e return singleton->shallow_gdscript_cache[p_path]; } - Ref parser_ref = get_parser(p_path, GDScriptParserRef::PARSED, r_error); - if (r_error != OK) { - return Ref(); - } - Ref script; script.instantiate(); script->set_path(p_path, true); script->load_source_code(p_path); + + Ref parser_ref = get_parser(p_path, GDScriptParserRef::PARSED, r_error); + if (r_error != OK) { + return script; + } + GDScriptCompiler::make_scripts(script.ptr(), parser_ref->get_parser()->get_tree(), true); singleton->shallow_gdscript_cache[p_path] = script;