Merge pull request #48131 from LightningAA/fix-48113-3.x
[3.x] Fix Array.max() navigating to @GDScript.max()
This commit is contained in:
commit
4185a22ca8
1 changed files with 10 additions and 9 deletions
|
@ -3317,15 +3317,6 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < GDScriptFunctions::FUNC_MAX; i++) {
|
|
||||||
if (GDScriptFunctions::get_func_name(GDScriptFunctions::Function(i)) == p_symbol) {
|
|
||||||
r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_METHOD;
|
|
||||||
r_result.class_name = "@GDScript";
|
|
||||||
r_result.class_member = p_symbol;
|
|
||||||
return OK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ("PI" == p_symbol || "TAU" == p_symbol || "INF" == p_symbol || "NAN" == p_symbol) {
|
if ("PI" == p_symbol || "TAU" == p_symbol || "INF" == p_symbol || "NAN" == p_symbol) {
|
||||||
r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT;
|
r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_CONSTANT;
|
||||||
r_result.class_name = "@GDScript";
|
r_result.class_name = "@GDScript";
|
||||||
|
@ -3537,6 +3528,16 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < GDScriptFunctions::FUNC_MAX; i++) {
|
||||||
|
// this has to get run after parsing because otherwise functions like Array.max() will trigger it
|
||||||
|
if (GDScriptFunctions::get_func_name(GDScriptFunctions::Function(i)) == p_symbol) {
|
||||||
|
r_result.type = ScriptLanguage::LookupResult::RESULT_CLASS_METHOD;
|
||||||
|
r_result.class_name = "@GDScript";
|
||||||
|
r_result.class_member = p_symbol;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ERR_CANT_RESOLVE;
|
return ERR_CANT_RESOLVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue