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

Have GDScriptWorkspace::list_script_files respect .gdignore.

This commit is contained in:
R. Alex Hofer
2024-04-20 10:22:06 -04:00
parent 4a0160241f
commit 2452176990

View File

@@ -233,7 +233,15 @@ void GDScriptWorkspace::reload_all_workspace_scripts() {
void GDScriptWorkspace::list_script_files(const String &p_root_dir, List<String> &r_files) {
Error err;
Ref<DirAccess> dir = DirAccess::open(p_root_dir, &err);
if (OK == err) {
if (OK != err) {
return;
}
// Ignore scripts in directories with a .gdignore file.
if (dir->file_exists(".gdignore")) {
return;
}
dir->list_dir_begin();
String file_name = dir->get_next();
while (file_name.length()) {
@@ -245,7 +253,6 @@ void GDScriptWorkspace::list_script_files(const String &p_root_dir, List<String>
}
file_name = dir->get_next();
}
}
}
ExtendGDScriptParser *GDScriptWorkspace::get_parse_successed_script(const String &p_path) {