Hot-reload only changed scripts

This commit is contained in:
rune-scape 2023-12-29 23:06:54 -08:00
parent 13a0d6e9b2
commit cde478bda6
17 changed files with 113 additions and 38 deletions

View file

@ -593,9 +593,15 @@ void EditorDebuggerNode::set_breakpoints(const String &p_path, Array p_lines) {
}
}
void EditorDebuggerNode::reload_scripts() {
void EditorDebuggerNode::reload_all_scripts() {
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
dbg->reload_scripts();
dbg->reload_all_scripts();
});
}
void EditorDebuggerNode::reload_scripts(const Vector<String> &p_script_paths) {
_for_all(tabs, [&](ScriptEditorDebugger *dbg) {
dbg->reload_scripts(p_script_paths);
});
}

View file

@ -187,7 +187,8 @@ public:
bool is_skip_breakpoints() const;
void set_breakpoint(const String &p_path, int p_line, bool p_enabled);
void set_breakpoints(const String &p_path, Array p_lines);
void reload_scripts();
void reload_all_scripts();
void reload_scripts(const Vector<String> &p_script_paths);
// Remote inspector/edit.
void request_remote_tree();

View file

@ -1518,8 +1518,12 @@ void ScriptEditorDebugger::set_breakpoint(const String &p_path, int p_line, bool
}
}
void ScriptEditorDebugger::reload_scripts() {
_put_msg("reload_scripts", Array(), debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID);
void ScriptEditorDebugger::reload_all_scripts() {
_put_msg("reload_all_scripts", Array(), debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID);
}
void ScriptEditorDebugger::reload_scripts(const Vector<String> &p_script_paths) {
_put_msg("reload_scripts", Variant(p_script_paths).operator Array(), debugging_thread_id != Thread::UNASSIGNED_ID ? debugging_thread_id : Thread::MAIN_ID);
}
bool ScriptEditorDebugger::is_skip_breakpoints() {

View file

@ -300,7 +300,8 @@ public:
void update_live_edit_root();
void reload_scripts();
void reload_all_scripts();
void reload_scripts(const Vector<String> &p_script_paths);
bool is_skip_breakpoints();