MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / _get_directory_contents

Function _get_directory_contents

modules/gdscript/gdscript_editor.cpp:904–919  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

902}
903
904static void _get_directory_contents(EditorFileSystemDirectory *p_dir, HashMap<String, ScriptLanguage::CodeCompletionOption> &r_list, const StringName &p_required_type = StringName()) {
905 const String quote_style = EDITOR_GET("text_editor/completion/use_single_quotes") ? "'" : "\"";
906 const bool requires_type = !p_required_type.is_empty();
907
908 for (int i = 0; i < p_dir->get_file_count(); i++) {
909 if (requires_type && !ClassDB::is_parent_class(p_dir->get_file_type(i), p_required_type)) {
910 continue;
911 }
912 ScriptLanguage::CodeCompletionOption option(p_dir->get_file_path(i).quote(quote_style), ScriptLanguage::CODE_COMPLETION_KIND_FILE_PATH);
913 r_list.insert(option.display, option);
914 }
915
916 for (int i = 0; i < p_dir->get_subdir_count(); i++) {
917 _get_directory_contents(p_dir->get_subdir(i), r_list, p_required_type);
918 }
919}
920
921static void _find_annotation_arguments(const GDScriptParser::AnnotationNode *p_annotation, int p_argument, const String p_quote_style, HashMap<String, ScriptLanguage::CodeCompletionOption> &r_result, String &r_arghint) {
922 ERR_FAIL_NULL(p_annotation);

Callers 3

_list_call_argumentsFunction · 0.70
_find_call_argumentsFunction · 0.70
complete_codeMethod · 0.70

Calls 9

get_file_countMethod · 0.80
get_file_typeMethod · 0.80
quoteMethod · 0.80
get_subdir_countMethod · 0.80
get_subdirMethod · 0.80
StringNameClass · 0.50
is_emptyMethod · 0.45
get_file_pathMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected