The IDE you know, rebuilt in Rust. IntelliJ IDEA–style keymap, tool windows and search-everywhere in a fast native app: editor, code insight, debugger, Git, terminal, database and HTTP clients for 60+ languages.
TypeScript code-editorcross-platformdapdatabase-clientdebuggerdesktop-appdeveloper-toolsgithttp-clientideintellijlsprusttauriterminal
use openidea_plugin::{mock::MockHost, *};
#[test]
fn validation_receives_mock_project_and_can_refuse_each_launch_kind() {
struct Validator;
impl RunTargetValidation for Validator {
fn validate(&mut self, project: &str, target: &str, launch: &RunTargetLaunch) -> Result<(), String> {
assert!(!project.is_empty());
assert_eq!(launch.program, "composer");
if target == "stopped" { Err("Project runtime is stopped".into()) } else { Ok(()) }
}
}
let mock = MockHost::install();
for operation in [RunTargetOperation::Run, RunTargetOperation::Test, RunTargetOperation::Debug] {
let launch = RunTargetLaunch { operation, program: "composer".into(), cwd: "/project".into() };
assert!(mock.validate_run_target(&mut Validator, "running", &launch).is_ok());
assert_eq!(
mock.validate_run_target(&mut Validator, "stopped", &launch),
Err("Project runtime is stopped".into())
);
}
}