mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Allow some non-integer built-in constants in gdscript
This commit is contained in:
parent
4e4702e386
commit
ba974b8d1e
8 changed files with 104 additions and 18 deletions
|
@ -2442,7 +2442,7 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
|
|||
} break;
|
||||
case GDScriptParser::COMPLETION_BUILT_IN_TYPE_CONSTANT: {
|
||||
List<StringName> constants;
|
||||
Variant::get_numeric_constants_for_type(parser.get_completion_built_in_constant(), &constants);
|
||||
Variant::get_constants_for_type(parser.get_completion_built_in_constant(), &constants);
|
||||
for (List<StringName>::Element *E = constants.front(); E; E = E->next()) {
|
||||
options.insert(E->get().operator String());
|
||||
}
|
||||
|
@ -3065,7 +3065,7 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
|
|||
case GDScriptParser::DataType::BUILTIN: {
|
||||
base_type.has_type = false;
|
||||
|
||||
if (Variant::has_numeric_constant(base_type.builtin_type, p_symbol)) {
|
||||
if (Variant::has_constant(base_type.builtin_type, p_symbol)) {
|
||||
r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT;
|
||||
r_result.class_name = Variant::get_type_name(base_type.builtin_type);
|
||||
r_result.class_member = p_symbol;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue