summaryrefslogtreecommitdiffstats
path: root/core/object/script_language.h
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2022-03-09 00:03:36 +1000
committerEric M <itsjusteza@gmail.com>2022-04-01 20:39:09 +1000
commit4ab605d14d0c18aeeded545e3cc453734df7abd7 (patch)
tree493e281c0dc21436b5c22a1071a086b66985aa2e /core/object/script_language.h
parent74b07dd19428ac6991d77aeb26ce0a66bfad4817 (diff)
downloadredot-engine-4ab605d14d0c18aeeded545e3cc453734df7abd7.tar.gz
Improve sorting of Code Completion options.
Done by ordering options by their location in the code - e.g. local, parent class, global, etc.
Diffstat (limited to 'core/object/script_language.h')
-rw-r--r--core/object/script_language.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/core/object/script_language.h b/core/object/script_language.h
index 6161a0fc0f..af4f276825 100644
--- a/core/object/script_language.h
+++ b/core/object/script_language.h
@@ -311,6 +311,13 @@ public:
CODE_COMPLETION_KIND_MAX
};
+ enum CodeCompletionLocation {
+ LOCATION_LOCAL = 0,
+ LOCATION_PARENT_MASK = 1 << 8,
+ LOCATION_OTHER_USER_CODE = 1 << 9,
+ LOCATION_OTHER = 1 << 10,
+ };
+
struct CodeCompletionOption {
CodeCompletionKind kind = CODE_COMPLETION_KIND_PLAIN_TEXT;
String display;
@@ -319,13 +326,15 @@ public:
RES icon;
Variant default_value;
Vector<Pair<int, int>> matches;
+ int location = LOCATION_OTHER;
CodeCompletionOption() {}
- CodeCompletionOption(const String &p_text, CodeCompletionKind p_kind) {
+ CodeCompletionOption(const String &p_text, CodeCompletionKind p_kind, int p_location = LOCATION_OTHER) {
display = p_text;
insert_text = p_text;
kind = p_kind;
+ location = p_location;
}
};