Invocation, options and results
Linktopaz lsp
topaz lsp
Input
Use topaz lsp without a positional operand. The accepted options are - or -, -, -, -, - and -. The compiler defaults to self for the current language profile.
Memory and time budgets are positive decimal integers. Explicit options override TOPAZ_ and TOPAZ_. The defaults are 8192 MiB and 1800000 ms. Reject missing values, zero budgets, malformed numbers, unsupported language profiles, repeated options, equals forms and all unlisted options before starting the session.
initialize. selects a local workspace when supplied. The CLI root is the initial workspace and the fallback when initialization supplies no local root. Bind the compiler to the admitted workspace language profile. An explicitly selected compiler that cannot serve that profile fails without silently choosing another compiler.
Options and conflicts
| Option | Default | Contract | Conflicts |
|---|---|---|---|
--compiler rust|self | self | compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source. | None listed |
--verbose | false | Reports the selected compiler and whether it was explicit or the default. For | None listed |
--root <dir> | Not specified | run the deterministic stdio language server; package diagnostics use initialize.rootUri (or --root) with a valid locked package and open-document overlays | None listed |
--language-version <5.21> | 5.21 | language version selector | None listed |
--compiler-memory-mib <MiB> | 8192 | self compiler worker memory budget (8192); overrides TOPAZ_COMPILER_MEMORY_MIB A positive integer is required. Environment input: TOPAZ_COMPILER_MEMORY_MIB. | None listed |
--compiler-time-ms <ms> | 1800000 | self compilation wall-clock budget (1800000); overrides TOPAZ_COMPILER_TIME_MS A positive integer is required. Environment input: TOPAZ_COMPILER_TIME_MS. | None listed |
Output channels
stdout
stderr
Exit status
0
The client ends the session with an exit notification or clean end of input between messages.
1
Startup arguments, locked workspace state, compiler selection, worker startup, transport framing or session input or output fails.
Effects
Read the selected local source tree and its already materialized dependencies. Open document content replaces the corresponding disk content only in the session snapshot.
Keep edits and proposed renames in protocol responses. Do not write the source tree, manifest, lock file or vendored files. Any compiler worker storage is private temporary state and is reclaimed when the session ends.
Only a local file root participates in package loading. A root URI that cannot denote a local directory leaves the CLI root fallback in effect and grants no remote filesystem access.
Use standard input and standard output for transport. Do not open a listening socket, contact a registry, download a compiler or fetch imports.
The same installed toolchain, selected compiler, language profile, workspace bytes, valid lock, document overlay sequence and request sequence produce the same semantic responses and diagnostic ordering.
Protocol identifiers are copied from requests. Client scheduling and resource timeout outcomes are outside a byte comparison unless the request order, budgets and termination conditions are also fixed.
A workspace containing topaz. uses its package graph and a valid topaz. for package diagnostics. Missing, stale or invalid locked dependencies are errors and are not repaired by the server.
Read dependency entries in the table form required by the package contract. A standalone document without a package is checked as a standalone source snapshot. The server never runs lock, add or vendor.
Operation
LinkThe language server uses the initialized workspace root or the selected package root for package diagnostics. Open documents supply source overlays.
Option conditions
Link- cannot be combined with bootstrap - or -
Behavior contract
LinkCommand behavior
Arguments and rejection
Use topaz lsp without a positional operand. The accepted options are - or -, -, -, -, - and -. The compiler defaults to self for the current language profile.
Memory and time budgets are positive decimal integers. Explicit options override TOPAZ_ and TOPAZ_. The defaults are 8192 MiB and 1800000 ms. Reject missing values, zero budgets, malformed numbers, unsupported language profiles, repeated options, equals forms and all unlisted options before starting the session.
initialize. selects a local workspace when supplied. The CLI root is the initial workspace and the fallback when initialization supplies no local root. Bind the compiler to the admitted workspace language profile. An explicitly selected compiler that cannot serve that profile fails without silently choosing another compiler.
Output
Standard output contains only LSP messages. Each message has a Content- header, a blank line and the indicated number of UTF-8 JSON bytes. JSON-RPC response identifiers match their requests. Diagnostics use protocol notifications and do not become a human stdout banner.
Human startup and transport errors use standard error. - reports the resolved compiler and selection origin on standard error. There is no separate human or selectable JSON report mode. Reject both - and - as unsupported startup options.
Initialization describes the supported editor capabilities. Request failures use protocol error responses when a response can be sent. Program diagnostics in a valid response do not by themselves terminate the server.
Exit status
Exit 0 when the client ends the session with an exit notification or clean end of input between messages.
Exit 1 for invalid startup arguments, invalid locked workspace state, an unavailable selected compiler, failure to start a compiler worker, malformed or truncated transport framing, or failure to read or write the session stream. No response for an unfinished request is presented as a successful result.
Filesystem effects
Read the selected local source tree and its already materialized dependencies. Open document content replaces the corresponding disk content only in the session snapshot.
Keep edits and proposed renames in protocol responses. Do not write the source tree, manifest, lock file or vendored files. Any compiler worker storage is private temporary state and is reclaimed when the session ends.
Only a local file root participates in package loading. A root URI that cannot denote a local directory leaves the CLI root fallback in effect and grants no remote filesystem access.
Network access
Use standard input and standard output for transport. Do not open a listening socket, contact a registry, download a compiler or fetch imports.
Reproducibility
The same installed toolchain, selected compiler, language profile, workspace bytes, valid lock, document overlay sequence and request sequence produce the same semantic responses and diagnostic ordering.
Protocol identifiers are copied from requests. Client scheduling and resource timeout outcomes are outside a byte comparison unless the request order, budgets and termination conditions are also fixed.
Packages and locks
A workspace containing topaz. uses its package graph and a valid topaz. for package diagnostics. Missing, stale or invalid locked dependencies are errors and are not repaired by the server.
Read dependency entries in the table form required by the package contract. A standalone document without a package is checked as a standalone source snapshot. The server never runs lock, add or vendor.
Why
Editor requests and diagnostic responses belong to a framed protocol. Keeping logs on standard error prevents a human message from corrupting that protocol. Open document overlays express unsaved editor state and must not become filesystem writes.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174
The linked public CLI recipe checks the exact displayed argument rejection before the requested operation. It does not execute the successful operation or verify its effects.
The reviewed recipe supplies a forbidden source operand and only checks startup rejection. A framed initialized editor session and its overlay effects are outside the execution allowlist.
Example contract
LinkExample contract
The invocation topaz lsp main. is expected to exit with 1.
The command has no positional source operand. The adapter-supplied fixture operand is deliberately rejected before its operation; this is an arity example, not a successful lsp session.
Why
lsp receives documents and workspace information through the editor protocol. Rejecting a source operand prevents it from being silently ignored.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174
Example
LinkArgument-rejection example
Linkfunction identity<T>(value: T) -> T {value}
Expected result
Expected result
Textual rejection details remain Pending in the reference model. The independent Tools example gate expects exit 1.
The command has no positional source operand. The adapter-supplied fixture operand is deliberately rejected before its operation; this is an arity example, not a successful lsp session.
Source evidence
- compiler/crates/topaz_cli/src/command/flags.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/command/dispatch.rs at
b48527d0a174 - compiler/crates/topaz_cli/src/compiler_support.rs at
b48527d0a174
Verification scope
LinkObserved with Topaz 5.21.3 on 2026-11-06T08:36:29.642Z. This invocation passed; exit 1. 3 assertions were evaluated against the independent expected result. Execution record. This result covers the displayed invocation.