atmos.lsp
The atmos.lsp function runs atmos lsp through the current Atmos executable. Its one subcommand starts the
Atmos Language Server Protocol server used for editor integration.
Usage
atmos.lsp(
*positionals,
flags = {},
args = [],
working_directory = ...,
env = ...,
output = "stream",
check = True,
)
Subcommands
Pass the subcommand as a string before the keyword arguments. The call atmos.lsp("start") runs atmos lsp start.
| Subcommand | Purpose |
|---|---|
start | Start the Atmos LSP server. |
See the atmos lsp start command reference for details.
Arguments
*positionals(Optional) Strings placed on the command line right after
lsp, in order: the subcommand. Every value must be a string.flags(Optional) A dictionary of command-line options; see flag translation. For
start, the key"transport"becomes--transportand acceptsstdio,tcp, orwebsocket, and the key"address"becomes--addressfor thetcpandwebsockettransports.args- (Optional) A list or tuple of strings appended after the flags.
working_directory,env,output,check(Optional) See
atmos.runfor process options and defaults.
Options other than the positionals are keyword-only.
Returns
A result with stdout, stderr, and exit_code. See atmos.run for output and error behavior.
Examples
Start a TCP server
atmos.lsp("start", flags = {"transport": "tcp", "address": "localhost:7777"})
This runs atmos lsp start --address=localhost:7777 --transport=tcp. The call returns when the server exits.
Start a WebSocket server on another port
atmos.lsp("start", flags = {"transport": "websocket", "address": "localhost:9000"})
The language server runs until it is stopped, so the script waits at this call for the whole lifetime of the server.
With the default stdio transport the server speaks to an editor over standard input and output, which a script
rarely provides. Editors normally launch atmos lsp start themselves, and a script has little reason to call it
unless it supervises a tcp or websocket server.
Related
atmos.runruns any Atmos command from an argument list.atmos lsp startdocuments the server and its transports.- Atmos Automation Language and the script step