mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-23 17:47:17 +01:00
Fix Script editor completion doesn't suggest members of a script for type hints
This commit is contained in:
parent
1d2a560819
commit
2693ad37f7
@ -2984,8 +2984,17 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_path
|
|||||||
base_type.has_type = false;
|
base_type.has_type = false;
|
||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
case GDScriptParser::DataType::SCRIPT:
|
|
||||||
case GDScriptParser::DataType::GDSCRIPT: {
|
case GDScriptParser::DataType::GDSCRIPT: {
|
||||||
|
Ref<GDScript> scr = base_type.script_type;
|
||||||
|
if (scr.is_valid()) {
|
||||||
|
for (const Map<StringName, Ref<GDScript>>::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 GDScriptParser::DataType::SCRIPT: {
|
||||||
Ref<Script> scr = base_type.script_type;
|
Ref<Script> scr = base_type.script_type;
|
||||||
if (scr.is_valid()) {
|
if (scr.is_valid()) {
|
||||||
Map<StringName, Variant> constants;
|
Map<StringName, Variant> constants;
|
||||||
|
@ -5633,6 +5633,7 @@ bool GDScriptParser::_parse_type(DataType &r_type, bool p_can_be_void) {
|
|||||||
can_index = false;
|
can_index = false;
|
||||||
tokenizer->advance();
|
tokenizer->advance();
|
||||||
} break;
|
} break;
|
||||||
|
case GDScriptTokenizer::TK_CURSOR:
|
||||||
case GDScriptTokenizer::TK_IDENTIFIER: {
|
case GDScriptTokenizer::TK_IDENTIFIER: {
|
||||||
if (can_index) {
|
if (can_index) {
|
||||||
_set_error("Unexpected identifier.");
|
_set_error("Unexpected identifier.");
|
||||||
|
Loading…
Reference in New Issue
Block a user