You've already forked godot
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:
@@ -233,7 +233,15 @@ void GDScriptWorkspace::reload_all_workspace_scripts() {
|
|||||||
void GDScriptWorkspace::list_script_files(const String &p_root_dir, List<String> &r_files) {
|
void GDScriptWorkspace::list_script_files(const String &p_root_dir, List<String> &r_files) {
|
||||||
Error err;
|
Error err;
|
||||||
Ref<DirAccess> dir = DirAccess::open(p_root_dir, &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();
|
dir->list_dir_begin();
|
||||||
String file_name = dir->get_next();
|
String file_name = dir->get_next();
|
||||||
while (file_name.length()) {
|
while (file_name.length()) {
|
||||||
@@ -246,7 +254,6 @@ void GDScriptWorkspace::list_script_files(const String &p_root_dir, List<String>
|
|||||||
file_name = dir->get_next();
|
file_name = dir->get_next();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ExtendGDScriptParser *GDScriptWorkspace::get_parse_successed_script(const String &p_path) {
|
ExtendGDScriptParser *GDScriptWorkspace::get_parse_successed_script(const String &p_path) {
|
||||||
HashMap<String, ExtendGDScriptParser *>::Iterator S = scripts.find(p_path);
|
HashMap<String, ExtendGDScriptParser *>::Iterator S = scripts.find(p_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user