1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add a dependency search mode for GDScript parser

- This mode avoids loading any other resource.
- Search for class_name now uses this mode, to avoid loading in the scan
thread.
- Implement get_dependencies() for GDScript loader, now exporting
dependencies only should include the preloaded resources.
This commit is contained in:
George Marques
2019-03-03 16:36:42 -03:00
parent 4f0590338f
commit bda60bfa29
4 changed files with 140 additions and 79 deletions

View File

@@ -533,6 +533,8 @@ private:
int error_line;
int error_column;
bool check_types;
bool dependencies_only;
List<String> dependencies;
#ifdef DEBUG_ENABLED
Set<int> *safe_lines;
#endif // DEBUG_ENABLED
@@ -634,7 +636,7 @@ public:
#ifdef DEBUG_ENABLED
const List<GDScriptWarning> &get_warnings() const { return warnings; }
#endif // DEBUG_ENABLED
Error parse(const String &p_code, const String &p_base_path = "", bool p_just_validate = false, const String &p_self_path = "", bool p_for_completion = false, Set<int> *r_safe_lines = NULL);
Error parse(const String &p_code, const String &p_base_path = "", bool p_just_validate = false, const String &p_self_path = "", bool p_for_completion = false, Set<int> *r_safe_lines = NULL, bool p_dependencies_only = false);
Error parse_bytecode(const Vector<uint8_t> &p_bytecode, const String &p_base_path = "", const String &p_self_path = "");
bool is_tool_script() const;
@@ -653,6 +655,8 @@ public:
int get_completion_argument_index();
int get_completion_identifier_is_function();
const List<String> &get_dependencies() const { return dependencies; }
void clear();
GDScriptParser();
~GDScriptParser();