Clean up EditorFileSystem script parsing

* Optimize only update modified/added/removed files.
* Clean up documentation parsing.
This commit is contained in:
Juan Linietsky 2023-01-18 17:32:28 +01:00
parent e514e3732a
commit 5bdc0d97d3
6 changed files with 82 additions and 65 deletions

View file

@ -263,6 +263,15 @@ void ScriptServer::remove_global_class(const StringName &p_class) {
global_classes.erase(p_class);
}
void ScriptServer::remove_global_class_by_path(const String &p_path) {
for (const KeyValue<StringName, GlobalScriptClass> &kv : global_classes) {
if (kv.value.path == p_path) {
global_classes.erase(kv.key);
return;
}
}
}
bool ScriptServer::is_global_class(const StringName &p_class) {
return global_classes.has(p_class);
}

View file

@ -80,6 +80,7 @@ public:
static void global_classes_clear();
static void add_global_class(const StringName &p_class, const StringName &p_base, const StringName &p_language, const String &p_path);
static void remove_global_class(const StringName &p_class);
static void remove_global_class_by_path(const String &p_path);
static bool is_global_class(const StringName &p_class);
static StringName get_global_class_language(const StringName &p_class);
static String get_global_class_path(const String &p_class);