Merge pull request #90949 from rhofour/gdignore

LSP: Have `GDScriptWorkspace::list_script_files` respect `.gdignore`.
This commit is contained in:
Rémi Verschelde 2024-04-29 10:09:42 +02:00
commit c33cd94509
No known key found for this signature in database
GPG Key ID: C3336907360768E1

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()) {
@ -246,7 +254,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) {
HashMap<String, ExtendGDScriptParser *>::Iterator S = scripts.find(p_path);