Skip to main content

mos_lsp/
main.rs

1//! `mos-lsp`: language-server stdio entry point (manifest ยง17).
2//!
3//! Editors spawn this binary and speak LSP over stdin/stdout. The
4//! protocol implementation lives in `mos_lsp::run` so it can be
5//! exercised from tests without owning the process.
6
7#![allow(
8    clippy::print_stderr,
9    reason = "binary entry point reports fatal protocol startup errors to stderr"
10)]
11
12use std::process::ExitCode;
13
14fn main() -> ExitCode {
15    match mos_lsp::run() {
16        Ok(()) => ExitCode::SUCCESS,
17        Err(err) => {
18            eprintln!("mos-lsp: {err}");
19            ExitCode::FAILURE
20        }
21    }
22}