diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-04-03 22:43:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-03 22:43:07 +0200 |
commit | 82c26f74ad63ac68288f0e2e936cf02a5bd1f513 (patch) | |
tree | 01327ac7af3fee5b3ef2c5e1bb367a3e7b864437 /editor/plugins | |
parent | a7dd698d4d0c46c777c87681d9d20c1a3bb7101e (diff) | |
parent | 7d5a40c3e6fbd90f02ae677fc20300c3f38772df (diff) |
Merge pull request #17865 from delftswa2018/enumLookupFix
Ctrl+Clicking a enum now scrolls down to it in the docs.
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/script_text_editor.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/editor/plugins/script_text_editor.cpp b/editor/plugins/script_text_editor.cpp index c8ea2f79fe..6c488fce55 100644 --- a/editor/plugins/script_text_editor.cpp +++ b/editor/plugins/script_text_editor.cpp @@ -789,6 +789,26 @@ void ScriptTextEditor::_lookup_symbol(const String &p_symbol, int p_row, int p_c emit_signal("go_to_help", "class_method:" + result.class_name + ":" + result.class_member); } break; + case ScriptLanguage::LookupResult::RESULT_CLASS_ENUM: { + + StringName cname = result.class_name; + StringName success; + while (true) { + success = ClassDB::get_integer_constant_enum(cname, result.class_member, true); + if (success != StringName()) { + result.class_name = cname; + cname = ClassDB::get_parent_class(cname); + } else { + break; + } + } + + emit_signal("go_to_help", "class_enum:" + result.class_name + ":" + result.class_member); + + } break; + case ScriptLanguage::LookupResult::RESULT_CLASS_TBD_GLOBALSCOPE: { + emit_signal("go_to_help", "class_global:" + result.class_name + ":" + result.class_member); + } break; } } } |