Expand description
monaco-vscode-server
is a Rust crate for managing the VSCode server backend.
It provides functionalities to download, start, stop, and manage the VSCode server,
which is used by monaco-vscode-api
to provide a Monaco editor with VSCode services.
§Features
embed
: Enables embedding the VSCode server binary directly into your application. When this feature is active, the server can be extracted and run without needing a separate download step at runtime, unless overridden.
§Quick Start
use monaco_vscode_server::{VscodeServerManager, ServerConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut manager = VscodeServerManager::new().await?;
manager.ensure_server().await?; // Downloads if not present or embedded
manager.start().await?;
println!("Server is running at {}", manager.url());
println!("Server info: {:?}", manager.info());
// Keep the server running for a bit (e.g., in a real app, it runs until shutdown)
tokio::time::sleep(tokio::time::Duration::from_secs(10)).await;
manager.stop().await?;
println!("Server stopped.");
Ok(())
}
Structs§
- Server
Config - Configuration for the VSCode server instance.
- Server
Info - Holds information about the detected or embedded VSCode server.
- Tauri
Config - Configuration specific to using
VscodeServerManager
within a Tauri application. - Tauri
Vscode Server - A wrapper around
VscodeServerManager
tailored for use in Tauri applications. - Vscode
Server Manager - Manages the lifecycle of a VSCode server instance.
Enums§
- Platform
- Supported platforms for VSCode server
- Server
Error - Error type for the
monaco-vscode-server
crate.
Functions§
- download_
server - Downloads and extracts the VSCode server based on the provided
ServerInfo
.