A11 (C++ runtime)
Native C++ implementation of the A11 streaming action runtime
Loading...
Searching...
No Matches
a11::flow::tool Namespace Reference

Functions

int RunLsp (std::istream &in, std::ostream &out)
 Speak the Language Server Protocol over two streams until the client stops.
 

Function Documentation

◆ RunLsp()

int a11::flow::tool::RunLsp ( std::istream &  in,
std::ostream &  out 
)

Speak the Language Server Protocol over two streams until the client stops.

The thin half of the tool: it owns the open documents, converts between the protocol's line-and-UTF-16-character positions and the byte offsets the language works in, and turns each request into one of the service's methods. Nothing about the language is decided here – what is a problem, what may be written at a caret and what a token means are answered once, in a11_flow_lang, and this is the shape an editor wants them in.

Returns the process's exit code: 0 for a clean shutdown/exit, 1 when the stream ended without one.