This repository has been archived on 2026-08-20. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
el-retired/ide/crates/el-ide-server/src/sse.rs
T
Will Anderson 602cd1586a feat: el-ide — native IDE for engram-lang, LSP, type graph, plugin ecosystem
Axum HTTP server (port 7771) serving a single-page IDE with CodeMirror 6
syntax highlighting for engram-lang, a force-directed type graph visualizer,
LSP (completions, hover, diagnostics), SSE-streamed build/run output, a
plugin host with five first-party plugins, and a reasoning panel that proxies
to engram-server. 28 tests across three crates, zero warnings.
2026-04-27 19:12:42 -05:00

21 lines
682 B
Rust

//! SSE helpers for streaming build/run output.
use axum::response::sse::Event;
/// Build a line-output SSE event, classifying the line as error/warning/success/info.
pub fn classify_line(line: &str) -> Event {
let event_type = if line.to_lowercase().contains("error") {
"error"
} else if line.to_lowercase().contains("warning") || line.to_lowercase().contains("warn") {
"warning"
} else if line.to_lowercase().contains("compiled")
|| line.to_lowercase().contains("ok")
|| line.to_lowercase().contains("success")
{
"success"
} else {
"info"
};
Event::default().event(event_type).data(line.to_string())
}