mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2024-12-24 12:47:12 +01:00
Ported "Fix Script editor completion doesn't suggest members of a script for type hints"
ray90514 - 7afbd5904e
For CScript.
This commit is contained in:
parent
4baf6dd61d
commit
711d08be2b
@ -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<CScript> scr = base_type.script_type;
|
||||
if (scr.is_valid()) {
|
||||
for (const Map<StringName, Ref<CScript>>::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<Script> scr = base_type.script_type;
|
||||
if (scr.is_valid()) {
|
||||
Map<StringName, Variant> constants;
|
||||
|
@ -5557,6 +5557,7 @@ bool CScriptParser::_parse_type(DataType &r_type, bool p_can_be_void) {
|
||||
can_index = false;
|
||||
tokenizer->advance();
|
||||
} break;
|
||||
case CScriptTokenizer::TK_CURSOR:
|
||||
case CScriptTokenizer::TK_IDENTIFIER: {
|
||||
if (can_index) {
|
||||
_set_error("Unexpected identifier.");
|
||||
|
Loading…
Reference in New Issue
Block a user