Файли
openidea/src-tauri/src/commands/debug.rs
T
LU XIANGRUIтаwildcatDownstairs ad1621dee6 feat(debugger): hot reload Flutter apps on save (#4392)
While a Flutter debug session runs, saving a Dart file of its package (or a package it depends on, from .dart_tool/package_config.json) hot reloads the app, on by default and switchable under Settings › Build, Execution, Deployment › Debugger › Flutter. Flutter sessions are recognised by the flutter.appStarted event; saves are debounced (300 ms) so Save All reloads once; files with Dart errors skip the reload until fixed; saves during a pause reload on resume; failures go to the Debug console. hotReload now passes a reason (save / manual).

Refs #4096

Co-authored-by: wildcatDownstairs <[email protected]>
2026-11-19 10:18:57 +08:00

28 рядки
840 B
Rust

//! IPC commands of `ide_host::ops::debug` (the shared implementation).
use crate::state::AppState;
use ide_command::desktop_command;
use ide_core::{DebugSessionId, IdeResult};
use ide_dap::HotReloadReason;
use tauri::State;
#[desktop_command(trust = trusted)]
#[tauri::command]
#[specta::specta]
pub async fn debug_hot_reload(
state: State<'_, AppState>,
session: DebugSessionId,
reason: HotReloadReason,
) -> IdeResult<()> {
ide_host::ops::debug::debug_hot_reload(&state.host, session, reason).await
}
#[desktop_command(trust = trusted)]
#[tauri::command]
#[specta::specta]
pub async fn debug_hot_restart(state: State<'_, AppState>, session: DebugSessionId) -> IdeResult<()> {
ide_host::ops::debug::debug_hot_restart(&state.host, session).await
}
ide_command::desktop_domain!(debug_hot_reload, debug_hot_restart);