Файли
openidea/src-tauri/src/commands/coverage.rs
T
l0ng-ai 2c9a6470ff feat(project): add project trust and restricted execution mode (#517)
Projects now open with a user-owned trust decision. The prompt offers Preview in Restricted Mode, Don't Open and Trust Project, with an optional trusted parent folder; preview is the default focus so Enter never grants trust.

Restricted projects keep browsing, editing, saving, search and highlighting. Project-controlled execution is denied by default in the backend: run, debug, build, tools, language servers, plugins and Git commands that could honour repository configuration. Trusting a project enables those paths without reopening it, and decisions can be revoked in Settings.

Terminals stay available when the user opens one, without project shell settings, environment or virtualenv activation. A shell prompt that runs git in the folder can still honour the repository's core.fsmonitor.

Fixes #462
2026-10-31 20:58:45 +08:00

41 рядки
1.4 KiB
Rust

//! IPC commands of `ide_host::ops::coverage` (the shared implementation).
use crate::state::AppState;
use ide_core::{IdeResult, IpcPath};
use ide_coverage::{CoveragePrepared, CoverageReportSpec, CoverageSuite};
#[allow(unused_imports)]
pub use ide_host::ops::coverage::*;
use ide_run::RunConfig;
use tauri::{State, Window};
/// How to run `config` with coverage: the command to launch and where its report will be,
/// or which tool is missing.
#[tauri::command]
#[specta::specta]
pub async fn coverage_prepare(
window: Window,
state: State<'_, AppState>,
config: RunConfig,
) -> IdeResult<CoveragePrepared> {
ide_host::ops::coverage::coverage_prepare(&state.host, window.label(), config).await
}
/// Reads the report a coverage run left behind.
#[tauri::command]
#[specta::specta]
pub async fn coverage_collect(
window: Window,
state: State<'_, AppState>,
report: CoverageReportSpec,
) -> IdeResult<CoverageSuite> {
ide_host::ops::coverage::coverage_collect(&state.host, window.label(), report).await
}
/// Reads a report collected elsewhere (CI): lcov, a Go cover profile or JaCoCo XML,
/// with paths mapped into this project.
#[tauri::command]
#[specta::specta]
pub async fn coverage_import(window: Window, state: State<'_, AppState>, path: IpcPath) -> IdeResult<CoverageSuite> {
ide_host::ops::coverage::coverage_import(&state.host, window.label(), path).await
}