Skip to content
Topaz6.0 · Before release
Download

Search documentation

Specification 6.0 · Not released · Tested product 5.21.3

Use arrow keys to choose a result. Press Enter to open.

Type an API name, diagnostic number, rule, or project topic.

    Tools

    lsp

    Serves editor requests over standard input and standard output.

    Invocation, options and results

    Link

    topaz lsp

    Synopsis
    1. topaz lsp

    Input

    Use topaz lsp without a positional operand. The accepted options are --compiler rust or --compiler self, --verbose, --root <dir>, --language-version <version>, --compiler-memory-mib <MiB> and --compiler-time-ms <ms>. The compiler defaults to self for the current language profile.

    Memory and time budgets are positive decimal integers. Explicit options override TOPAZ_COMPILER_MEMORY_MIB and TOPAZ_COMPILER_TIME_MS. 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.rootUri 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

    OptionDefaultContractConflicts
    --compiler rust|selfself

    compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source.

    None listed
    --verbosefalse

    Reports the selected compiler and whether it was explicit or the default. For version, prints the detailed release report.

    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.toml uses its package graph and a valid topaz.lock 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

    Link

    The language server uses the initialized workspace root or the selected package root for package diagnostics. Open documents supply source overlays.

    Option conditions

    Link

    --compiler cannot be combined with bootstrap --producer or --self-source

    Behavior contract

    Link
    Ruletools-commands-lsp.rule.behavior

    Command behavior

    Arguments and rejection

    Use topaz lsp without a positional operand. The accepted options are --compiler rust or --compiler self, --verbose, --root <dir>, --language-version <version>, --compiler-memory-mib <MiB> and --compiler-time-ms <ms>. The compiler defaults to self for the current language profile.

    Memory and time budgets are positive decimal integers. Explicit options override TOPAZ_COMPILER_MEMORY_MIB and TOPAZ_COMPILER_TIME_MS. 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.rootUri 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-Length 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. --verbose reports the resolved compiler and selection origin on standard error. There is no separate human or selectable JSON report mode. Reject both --format human and --format json 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.toml uses its package graph and a valid topaz.lock 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

    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

    Link
    Ruletools-commands-lsp.rule.invocation

    Example contract

    The invocation topaz lsp main.tpz --language-version 5.21 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

    Example

    Link

    Argument-rejection example

    Link
    main.tpzArgument-rejection exampleOpen in Playground
    1. function identity<T>(value: T) -> T {
    2. value
    3. }
    target product 5.21.3
    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

    Verification scope

    Link

    Observed 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.

    Related references

    Link

    Compiler selection

    Packages, locks and targets

    Menu

    Download