diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-05-05 16:49:15 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-05 16:49:15 +0200 |
commit | 4d50f747d5250e88cf2c35039af23eb3ac28aa4f (patch) | |
tree | 7349071eea52d9ea287c03003176893ea58fb1b9 /modules/gdscript/gdscript_editor.cpp | |
parent | 8227947d41eadc00ccbd3c2ddbcf83daa3591208 (diff) | |
parent | be7a353c70812e349861a7f5314d72425ae707cb (diff) | |
download | redot-engine-4d50f747d5250e88cf2c35039af23eb3ac28aa4f.tar.gz |
Merge pull request #37293 from Janglee123/ctrl-click-improvements
Improved go-to definition (Ctrl + Click)
Diffstat (limited to 'modules/gdscript/gdscript_editor.cpp')
-rw-r--r-- | modules/gdscript/gdscript_editor.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 7ad0682637..ab3228d076 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -1427,6 +1427,7 @@ static bool _guess_identifier_type_from_base(GDScriptCompletionContext &p_contex // Variable used in the same expression return false; } + if (_guess_expression_type(p_context, m.expression, r_type)) { return true; } @@ -3490,6 +3491,17 @@ Error GDScriptLanguage::lookup_code(const String &p_code, const String &p_symbol return OK; } } break; + case GDScriptParser::COMPLETION_TYPE_HINT: { + + GDScriptParser::DataType base_type = context._class->base_type; + base_type.has_type = true; + base_type.kind = GDScriptParser::DataType::CLASS; + base_type.class_type = const_cast<GDScriptParser::ClassNode *>(context._class); + + if (_lookup_symbol_from_base(base_type, p_symbol, false, r_result) == OK) { + return OK; + } + } break; default: { } } |