Skip to main content

Crate corsa

Crate corsa 

Source
Expand description

Top-level facade crate for the corsa workspace.

This crate re-exports the building blocks used to talk to typescript-go over stdio:

  • api for the tsgo API bindings
  • jsonrpc for stdio JSON-RPC framing and transport
  • lsp for LSP clients and virtual-document overlays
  • orchestrator for local orchestration plus optional experimental distributed helpers
  • observability for structured runtime events
  • runtime for the lightweight in-house executor
  • utils for shared type-text and checker-adjacent helpers

§Examples

use corsa::{
    jsonrpc::RequestId,
    lsp::{VirtualChange, VirtualDocument},
    runtime::block_on,
};

let mut document = VirtualDocument::untitled("/demo.ts", "typescript", "const value = 1;")?;
document.apply_changes(&[VirtualChange::replace("const value = 2;")])?;
assert_eq!(document.text, "const value = 2;");

let request_id = RequestId::integer(7);
assert_eq!(request_id.to_string(), "7");

let value = block_on(async { 21 * 2 });
assert_eq!(value, 42);

Modules§

api
Re-exports the tsgo stdio API bindings.
error
Re-exports shared error types.
fast
Re-exports performance-oriented building blocks such as CompactString.
jsonrpc
Re-exports JSON-RPC transport primitives.
lsp
Re-exports LSP clients, overlays, and virtual document helpers.
observability
Re-exports structured operational events used across the workspace.
orchestrator
Re-exports client orchestration and replicated-state helpers.
process
Re-exports process spawning primitives.
runtime
Re-exports the lightweight in-house runtime.
utils
Re-exports shared pure utility helpers.

Enums§

CorsaError
Workspace-wide error type for process, transport, and protocol failures.
CorsaEvent
Structured runtime events that embedders can observe.
TsgoError
Workspace-wide error type for process, transport, and protocol failures.
TsgoEvent
Structured runtime events that embedders can observe.

Traits§

CorsaObserver
Sink for structured operational events emitted by the workspace.
TsgoObserver
Sink for structured operational events emitted by the workspace.

Type Aliases§

Result
Standard result alias used across the workspace.
SharedObserver
Shared observer handle used across configs and transports.