mirror of
https://github.com/godotengine/godot.git
synced 2025-01-18 20:23:58 +08:00
Merge pull request #90949 from rhofour/gdignore
LSP: Have `GDScriptWorkspace::list_script_files` respect `.gdignore`.
This commit is contained in:
commit
c33cd94509
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user