diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-12-02 14:15:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-02 14:15:38 +0100 |
commit | d1231be1c8f8f2c16fd1047adcd3c7f997a07c1f (patch) | |
tree | f7ceec96ce5251a3f7ed7ed33abcb163f29f0ad3 /editor/editor_file_system.cpp | |
parent | 0019aa940e661fcc5e6b8f333ca291ba8726e6e4 (diff) | |
parent | 42bfa169960b59c5d9337e9f63862f5feae92d58 (diff) |
Merge pull request #41095 from ThakeeNathees/GDScript-Documentation
GDScript(2.0) Documentation generation system
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r-- | editor/editor_file_system.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp index c66bc9b3fa..6dcc505a11 100644 --- a/editor/editor_file_system.cpp +++ b/editor/editor_file_system.cpp @@ -799,6 +799,20 @@ void EditorFileSystem::_scan_new_dir(EditorFileSystemDirectory *p_dir, DirAccess } } + 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]); + } + } + } + p_dir->files.push_back(fi); p_progress.update(idx, total); } |