You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix synchronization of global class name
This commit is contained in:
@@ -309,13 +309,14 @@ void GDScriptParser::set_last_completion_call_arg(int p_argument) {
|
||||
completion_call_stack.back()->get().argument = p_argument;
|
||||
}
|
||||
|
||||
Error GDScriptParser::parse(const String &p_source_code, const String &p_script_path, bool p_for_completion) {
|
||||
Error GDScriptParser::parse(const String &p_source_code, const String &p_script_path, bool p_for_completion, bool p_parse_body) {
|
||||
clear();
|
||||
|
||||
String source = p_source_code;
|
||||
int cursor_line = -1;
|
||||
int cursor_column = -1;
|
||||
for_completion = p_for_completion;
|
||||
parse_body = p_parse_body;
|
||||
|
||||
int tab_size = 4;
|
||||
#ifdef TOOLS_ENABLED
|
||||
@@ -689,6 +690,12 @@ void GDScriptParser::parse_program() {
|
||||
}
|
||||
}
|
||||
|
||||
// When the only thing needed is the class name and the icon, we don't need to parse the hole file.
|
||||
// It really speed up the call to GDScriptLanguage::get_global_class_name especially for large script.
|
||||
if (!parse_body) {
|
||||
return;
|
||||
}
|
||||
|
||||
#undef PUSH_PENDING_ANNOTATIONS_TO_HEAD
|
||||
|
||||
parse_class_body(true);
|
||||
|
||||
Reference in New Issue
Block a user