Skip to main content

start_compilation

Function start_compilation 

Source
pub fn start_compilation(
    activator: &mut dyn ModeActivator,
    cmdline: Option<String>,
    cwd: Option<PathBuf>,
) -> Option<BufferId>
Expand description

Provision the *compilation* buffer and kick off a run — the compilation mode’s own responsibility, driven through the &mut-backed [ModeActivator::ensure_named_document] creation seam.

Called from the AppEffect::CompileRun dispatch arm (which passes the Editor as &mut dyn ModeActivator). Creates + activates the *compilation* buffer on first use — activation runs CompilationMode’s on_activate, establishing the streaming drain before the service publishes its first Reset — then runs the registered CompilationServiceHandle. Idempotent on :recompile (reuses the buffer; the drain from the first activation stays live).

Returns the buffer id (so the host can activate the buffer + repaint), or None when the compilation service is not registered.