Skip to content

Commit

Permalink
Merge pull request #92885 from Chaosus/fix_goto_definition_for_new
Browse files Browse the repository at this point in the history
Fix goto definition for `new` method
  • Loading branch information
akien-mga committed Jun 12, 2024
2 parents 5bab95a + 5962646 commit 4516050
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/gdscript/gdscript_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3571,9 +3571,13 @@ static Error _lookup_symbol_from_base(const GDScriptParser::DataType &p_base, co
switch (base_type.kind) {
case GDScriptParser::DataType::CLASS: {
if (base_type.class_type) {
if (base_type.class_type->has_member(p_symbol)) {
String name = p_symbol;
if (name == "new") {
name = "_init";
}
if (base_type.class_type->has_member(name)) {
r_result.type = ScriptLanguage::LOOKUP_RESULT_SCRIPT_LOCATION;
r_result.location = base_type.class_type->get_member(p_symbol).get_line();
r_result.location = base_type.class_type->get_member(name).get_line();
r_result.class_path = base_type.script_path;
Error err = OK;
r_result.script = GDScriptCache::get_shallow_script(r_result.class_path, err);
Expand Down

0 comments on commit 4516050

Please sign in to comment.