summaryrefslogtreecommitdiffstats
path: root/core/object/script_language.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/object/script_language.h')
-rw-r--r--core/object/script_language.h19
1 files changed, 15 insertions, 4 deletions
diff --git a/core/object/script_language.h b/core/object/script_language.h
index 696c9a94a5..2b685c77a3 100644
--- a/core/object/script_language.h
+++ b/core/object/script_language.h
@@ -35,6 +35,8 @@
#include "core/io/resource.h"
#include "core/templates/pair.h"
#include "core/templates/rb_map.h"
+#include "core/templates/safe_refcount.h"
+#include "core/variant/typed_array.h"
class ScriptLanguage;
template <typename T>
@@ -51,7 +53,7 @@ class ScriptServer {
static int _language_count;
static bool scripting_enabled;
static bool reload_scripts_on_save;
- static bool languages_finished;
+ static SafeFlag languages_finished; // Used until GH-76581 is fixed properly.
struct GlobalScriptClass {
StringName language;
@@ -96,7 +98,7 @@ public:
static void init_languages();
static void finish_languages();
- static bool are_languages_finished() { return languages_finished; }
+ static bool are_languages_finished() { return languages_finished.is_set(); }
};
class ScriptInstance;
@@ -305,8 +307,8 @@ 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; }
- /* Keep enum in Sync with: */
- /* /scene/gui/code_edit.h - CodeEdit::CodeCompletionKind */
+ // Keep enums in sync with:
+ // scene/gui/code_edit.h - CodeEdit::CodeCompletionKind
enum CodeCompletionKind {
CODE_COMPLETION_KIND_CLASS,
CODE_COMPLETION_KIND_FUNCTION,
@@ -321,6 +323,7 @@ public:
CODE_COMPLETION_KIND_MAX
};
+ // scene/gui/code_edit.h - CodeEdit::CodeCompletionLocation
enum CodeCompletionLocation {
LOCATION_LOCAL = 0,
LOCATION_PARENT_MASK = 1 << 8,
@@ -336,6 +339,7 @@ public:
Ref<Resource> icon;
Variant default_value;
Vector<Pair<int, int>> matches;
+ Vector<Pair<int, int>> last_matches = { { -1, -1 } }; // This value correspond to an impossible match
int location = LOCATION_OTHER;
CodeCompletionOption() {}
@@ -346,6 +350,13 @@ public:
kind = p_kind;
location = p_location;
}
+
+ TypedArray<int> get_option_characteristics(const String &p_base);
+ void clear_characteristics();
+ TypedArray<int> get_option_cached_characteristics() const;
+
+ private:
+ TypedArray<int> charac;
};
virtual Error complete_code(const String &p_code, const String &p_path, Object *p_owner, List<CodeCompletionOption> *r_options, bool &r_force, String &r_call_hint) { return ERR_UNAVAILABLE; }