summaryrefslogtreecommitdiff
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp15
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]);
}
}
}