You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Added constants from types in code completion, somehow this was never added.
Stuff like Label.ALIGN_CENTER or Mesh.PRIMITIVE_TRIANGLES did not complete..
(cherry picked from commit b83350f4b2)
This commit is contained in:
committed by
Rémi Verschelde
parent
3ff8dea5f9
commit
a72945f4e3
@@ -2112,7 +2112,18 @@ Error GDScriptLanguage::complete_code(const String& p_code, const String& p_base
|
|||||||
GDCompletionIdentifier t;
|
GDCompletionIdentifier t;
|
||||||
if (_guess_expression_type(context,static_cast<const GDParser::OperatorNode *>(node)->arguments[0],p.get_completion_line(),t)) {
|
if (_guess_expression_type(context,static_cast<const GDParser::OperatorNode *>(node)->arguments[0],p.get_completion_line(),t)) {
|
||||||
|
|
||||||
if (t.type==Variant::OBJECT && t.obj_type!=StringName()) {
|
if (t.type==Variant::OBJECT && t.obj_type=="GDNativeClass") {
|
||||||
|
//native enum
|
||||||
|
Ref<GDNativeClass> gdn = t.value;
|
||||||
|
if (gdn.is_valid()) {
|
||||||
|
StringName cn = gdn->get_name();
|
||||||
|
List<String> cnames;
|
||||||
|
ObjectTypeDB::get_integer_constant_list(cn,&cnames);
|
||||||
|
for (List<String>::Element *E=cnames.front();E;E=E->next()) {
|
||||||
|
options.insert(E->get());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (t.type==Variant::OBJECT && t.obj_type!=StringName()) {
|
||||||
|
|
||||||
Ref<GDScript> on_script;
|
Ref<GDScript> on_script;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user