From 37f1e86108a84c9b371e37c3854d8a03c8aea743 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 12 Sep 2016 10:52:29 -0300 Subject: Do ctrl-click on any code identifier to go to definiton or help page. --- core/script_language.h | 20 ++ modules/gdscript/gd_compiler.cpp | 19 ++ modules/gdscript/gd_editor.cpp | 437 ++++++++++++++++++++++++++ modules/gdscript/gd_parser.cpp | 9 + modules/gdscript/gd_parser.h | 3 +- modules/gdscript/gd_script.h | 15 + scene/gui/text_edit.cpp | 147 ++++++++- scene/gui/text_edit.h | 8 + tools/editor/plugins/script_editor_plugin.cpp | 47 ++- tools/editor/plugins/script_editor_plugin.h | 4 +- tools/editor/plugins/script_text_editor.cpp | 77 ++++- tools/editor/plugins/script_text_editor.h | 1 + 12 files changed, 778 insertions(+), 9 deletions(-) diff --git a/core/script_language.h b/core/script_language.h index 1b037e908c..53af4c74d1 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -122,6 +122,7 @@ public: virtual void get_script_method_list(List *p_list) const=0; virtual void get_script_property_list(List *p_list) const=0; + virtual int get_member_line(const StringName& p_member) const { return 0; } Script() {} }; @@ -207,7 +208,26 @@ public: virtual bool has_named_classes() const=0; virtual int find_function(const String& p_function,const String& p_code) const=0; virtual String make_function(const String& p_class,const String& p_name,const StringArray& p_args) const=0; + virtual Error complete_code(const String& p_code, const String& p_base_path, Object*p_owner,List* r_options,String& r_call_hint) { return ERR_UNAVAILABLE; } + + struct LookupResult { + enum Type { + RESULT_SCRIPT_LOCATION, + RESULT_CLASS, + RESULT_CLASS_CONSTANT, + RESULT_CLASS_PROPERTY, + RESULT_CLASS_METHOD + }; + Type type; + Ref