From 711d08be2b7e21aa649554d3b9edd4ba1f62e7c7 Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 22 Dec 2022 16:45:10 +0100 Subject: [PATCH] Ported "Fix Script editor completion doesn't suggest members of a script for type hints" ray90514 - https://github.com/godotengine/godot/commit/7afbd5904e8cfccd8e87ddfca9f05359ca2df113 For CScript. --- modules/cscript/cscript_editor.cpp | 12 +++++++++++- modules/cscript/cscript_parser.cpp | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/cscript/cscript_editor.cpp b/modules/cscript/cscript_editor.cpp index 8a47863c1..24eb1efc3 100644 --- a/modules/cscript/cscript_editor.cpp +++ b/modules/cscript/cscript_editor.cpp @@ -2909,8 +2909,18 @@ Error CScriptLanguage::complete_code(const String &p_code, const String &p_path, base_type.has_type = false; } } break; - case CScriptParser::DataType::SCRIPT: + case CScriptParser::DataType::CSCRIPT: { + Ref scr = base_type.script_type; + if (scr.is_valid()) { + for (const Map>::Element *E = scr->get_subclasses().front(); E; E = E->next()) { + ScriptCodeCompletionOption option(E->key().operator String(), ScriptCodeCompletionOption::KIND_CLASS); + options.insert(option.display, option); + } + } + FALLTHROUGH; + } + case CScriptParser::DataType::SCRIPT: { Ref