diff options
author | Geequlim <geequlim@gmail.com> | 2019-06-13 17:17:20 +0800 |
---|---|---|
committer | Geequlim <geequlim@gmail.com> | 2019-07-04 14:00:14 +0800 |
commit | ed7ed52151a9eca2a60a418881bd7065529acb66 (patch) | |
tree | 914511435507d93e8cfafa1f395c5e96d8ae3eb0 /core | |
parent | 2293c612e6c0913b6999080c9f2fa77227348818 (diff) |
Parse more informations for code completion
Diffstat (limited to 'core')
-rw-r--r-- | core/script_language.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/core/script_language.h b/core/script_language.h index b0c60b4e90..cb103646ed 100644 --- a/core/script_language.h +++ b/core/script_language.h @@ -200,6 +200,34 @@ public: virtual ~ScriptInstance(); }; +struct ScriptCodeCompletionOption { + enum Kind { + KIND_CLASS, + KIND_FUNCTION, + KIND_SIGNAL, + KIND_VARIABLE, + KIND_MEMBER, + KIND_ENUM, + KIND_CONSTANT, + KIND_NODE_PATH, + KIND_FILE_PATH, + KIND_PLAIN_TEXT, + }; + Kind kind; + String display; + String insert_text; + + ScriptCodeCompletionOption() { + kind = KIND_PLAIN_TEXT; + } + + ScriptCodeCompletionOption(const String &p_text, Kind p_kind) { + display = p_text; + insert_text = p_text; + kind = p_kind; + } +}; + class ScriptCodeCompletionCache { static ScriptCodeCompletionCache *singleton; @@ -250,7 +278,7 @@ public: virtual Error open_in_external_editor(const Ref<Script> &p_script, int p_line, int p_col) { return ERR_UNAVAILABLE; } virtual bool overrides_external_editor() { return false; } - virtual Error complete_code(const String &p_code, const String &p_path, Object *p_owner, List<String> *r_options, bool &r_force, String &r_call_hint) { return ERR_UNAVAILABLE; } + virtual Error complete_code(const String &p_code, const String &p_path, Object *p_owner, List<ScriptCodeCompletionOption> *r_options, bool &r_force, String &r_call_hint) { return ERR_UNAVAILABLE; } struct LookupResult { enum Type { |