diff options
author | Thakee Nathees <thakeenathees@gmail.com> | 2020-11-29 09:12:06 +0530 |
---|---|---|
committer | Thakee Nathees <thakeenathees@gmail.com> | 2020-12-02 00:48:39 +0530 |
commit | 42bfa169960b59c5d9337e9f63862f5feae92d58 (patch) | |
tree | 5d20c798d3163bf6bbd80e5658278331d98c4ed2 /editor/editor_file_system.cpp | |
parent | d0e7d9b62f0bcc2ba438b12c8bfbf68d82fff0ea (diff) | |
download | redot-engine-42bfa169960b59c5d9337e9f63862f5feae92d58.tar.gz |
Refactor DocData into core and editor (DocTools) parts
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r-- | editor/editor_file_system.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index 44c29ab81f..6dcc505a11 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -799,11 +799,16 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess } } - if (fc) { - for (int i = 0; i < ScriptServer::get_language_count(); i++) { - ScriptLanguage *lang = ScriptServer::get_language(i); - if (lang->has_documentation() && fc->type == lang->get_type()) { - ResourceLoader::load(path); + for (int i = 0; i < ScriptServer::get_language_count(); i++) { + ScriptLanguage *lang = ScriptServer::get_language(i); + if (lang->supports_documentation() && fi->type == lang->get_type()) { + Ref<Script> script = ResourceLoader::load(path); + if (script == nullptr) { + continue; + } + const Vector<DocData::ClassDoc> &docs = script->get_documentation(); + for (int j = 0; j < docs.size(); j++) { + EditorHelp::get_doc_data()->add_doc(docs[j]); } } } |