Файли
openidea/src-tauri/src/commands/caches.rs
T

29 рядки
975 B
Rust
Неформатований Анотація Історія

Цей файл містить неоднозначні символи Юнікоду
Цей файл містить символи Юнікоду, які можна сплутати з іншими символами. Якщо ви вважаєте, що це зроблено навмисно, можете сміливо ігнорувати це попередження. Щоб показати їх, скористайтеся кнопкою Escape.
//! File › Invalidate Caches… and restarting the IDE.
use crate::windows::WindowsState;
use ide_core::IdeResult;
use ide_workspace::caches::{self, InvalidateCachesOptions};
use tauri::{AppHandle, Manager, State};
/// Schedules the invalidation for the next start (`None` cancels a pending one).
#[tauri::command]
#[specta::specta]
pub fn caches_schedule_invalidation(app: AppHandle, options: Option<InvalidateCachesOptions>) -> IdeResult<()> {
let data_dir = app.path().app_data_dir().map_err(|e| ide_core::IdeError::internal(e.to_string()))?;
match options {
Some(o) => caches::schedule(&data_dir, &o),
None => {
caches::cancel(&data_dir);
Ok(())
}
}
}
/// Quits through every window's unsaved-changes check, then starts again.
#[tauri::command]
#[specta::specta]
pub fn app_restart(app: AppHandle, windows: State<'_, WindowsState>) {
windows.set_restart();
super::window::app_quit(app, windows);
}