From 745f8e112fcf5d61e0fc377bdbc2539dd6b16ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 29 Jan 2024 21:00:26 +0100 Subject: Revert "Add UID support to GDScript files" This reverts commit c7f68a27ec4b825302998eeb5a400f869cd21cf7. We still think GDScript files need UIDs to allow safe refactoring, but we're still debating what form those should take exactly. So far there seems to be agreement that it shouldn't be done via an annotation as implemented here, so we're reverting this one for now, to revisit the feature in a future PR. --- modules/gdscript/gdscript.cpp | 122 ++++-------------------------------------- 1 file changed, 11 insertions(+), 111 deletions(-) (limited to 'modules/gdscript/gdscript.cpp') diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index 02c21618f0..0da7752940 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -55,7 +55,6 @@ #ifdef TOOLS_ENABLED #include "editor/editor_paths.h" -#include "editor/editor_settings.h" #endif #include @@ -1077,36 +1076,6 @@ Ref GDScript::get_base() const { return base; } -String GDScript::get_raw_source_code(const String &p_path, bool *r_error) { - Ref f = FileAccess::open(p_path, FileAccess::READ); - if (f.is_null()) { - if (r_error) { - *r_error = true; - } - return String(); - } - return f->get_as_utf8_string(); -} - -Vector2i GDScript::get_uid_lines(const String &p_source) { - GDScriptParser parser; - parser.parse(p_source, "", false); - const GDScriptParser::ClassNode *c = parser.get_tree(); - if (!c) { - return Vector2i(-1, -1); - } - return c->uid_lines; -} - -String GDScript::create_uid_line(const String &p_uid_str) { -#ifdef TOOLS_ENABLED - if (EDITOR_GET("text_editor/completion/use_single_quotes")) { - return vformat(R"(@uid('%s') # %s)", p_uid_str, RTR("Generated automatically, do not modify.")); - } -#endif - return vformat(R"(@uid("%s") # %s)", p_uid_str, RTR("Generated automatically, do not modify.")); -} - bool GDScript::inherits_script(const Ref