Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slight issues with autocompletion and member lists in GDScript #28609

Merged

Conversation

bojidar-bg
Copy link
Contributor

Fixes #27152
Fixes #28591

@bojidar-bg bojidar-bg added this to the 3.2 milestone May 2, 2019
@bojidar-bg bojidar-bg requested review from reduz and vnen as code owners May 2, 2019 14:16
@@ -1951,7 +1951,7 @@ static void _find_identifiers_in_base(const GDScriptCompletionContext &p_context
} else {
base_type.has_type = script->get_instance_base_type() != StringName();
base_type.kind = GDScriptParser::DataType::NATIVE;
base_type.script_type = script->get_instance_base_type();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The glories of static typing.. and auto-coercion.

Note that get_instance_base_type returns StringName, while script_type is a Ref<Script>. How C++ manages to convert one into the other is a complete mystery to me.
Explanations are welcome!

@@ -226,7 +226,7 @@ void GDScript::get_script_method_list(List<MethodInfo> *p_list) const {

const GDScript *current = this;
while (current) {
for (const Map<StringName, GDScriptFunction *>::Element *E = member_functions.front(); E; E = E->next()) {
for (const Map<StringName, GDScriptFunction *>::Element *E = current->member_functions.front(); E; E = E->next()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a bug that a static analysis tool might have been able to figure out :D

@akien-mga akien-mga merged commit d6aa285 into godotengine:master May 2, 2019
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants