| 2227 | } |
| 2228 | |
| 2229 | void CSharpScript::reload_registered_script(Ref<CSharpScript> p_script) { |
| 2230 | // Unlike `reload`, we print an error rather than silently returning, |
| 2231 | // as we can assert this won't be called a second time until invalidated. |
| 2232 | ERR_FAIL_COND(!p_script->reload_invalidated); |
| 2233 | |
| 2234 | p_script->valid = true; |
| 2235 | p_script->reload_invalidated = false; |
| 2236 | |
| 2237 | update_script_class_info(p_script); |
| 2238 | |
| 2239 | p_script->_update_exports(); |
| 2240 | |
| 2241 | #ifdef TOOLS_ENABLED |
| 2242 | // If the EditorFileSystem singleton is available, update the file; |
| 2243 | // otherwise, the file will be updated when the singleton becomes available. |
| 2244 | EditorFileSystem *efs = EditorFileSystem::get_singleton(); |
| 2245 | if (efs && !p_script->get_path().is_empty()) { |
| 2246 | efs->update_file(p_script->get_path()); |
| 2247 | } |
| 2248 | #endif |
| 2249 | } |
| 2250 | |
| 2251 | void CSharpScript::update_script_class_info(Ref<CSharpScript> p_script) { |
| 2252 | TypeInfo type_info; |
nothing calls this directly
no test coverage detected