/** * Language intelligence (docs/design/lsp.md): wire constants, message * builders, record codecs, and the client-side mirrors. * * The server terminates LSP and projects it into blit-native records: * per-backend phase/capabilities are *pushed* as whole-snapshot * `LSP_STATE` messages ({@link LspStateMirror}), diagnostics are *pushed* * as per-file replacement sets against a server-held cache * ({@link LspDiagMirror}), and point-in-time answers are *pulled* through * the single nonce-correlated `LSP_QUERY` opcode whose `kind` byte * selects the operation. * * Positions are 0-based lines with UTF-8 byte columns in both directions; * the server transcodes to each backend's negotiated encoding. All * integers little-endian, tightly packed, as everywhere in the protocol. */ import type { SessionId } from "./types.js"; import type { ReactiveStore } from "./reactive.js"; /** Attach to the workspace containing a path: [0x60][nonce:2][flags:1][diag_latency_ms:2][path_len:2][path:N]. * `path` is plain UTF-8 (client-chosen filesystem location, like * `FS_SYNC`); the server walks upward for root markers. */ export declare const C2S_LSP_OPEN = 96; /** Release an attachment (backends stay warm): [0x61][lsp_id:2] */ export declare const C2S_LSP_CLOSE = 97; /** Acknowledge a pushed update: [0x62][lsp_id:2][stream:1][update_id:4]. * `stream` is {@link LSP_STREAM_STATE} or {@link LSP_STREAM_DIAG}. */ export declare const C2S_LSP_ACK = 98; /** Point-in-time query: [0x63][nonce:2][lsp_id:2][kind:1][flags:1][line:4][col:4][path_len:2][path:N][arg_len:2][arg:N]. * `kind` is one of `LSP_QUERY_*`; `line`/`col` are ignored by the symbol * kinds (for `WS_SYMBOLS` the `line` field is reserved as a future * SymbolKind bitmask filter); `arg` carries the `WS_SYMBOLS` query * string or the `RENAME` new name. */ export declare const C2S_LSP_QUERY = 99; /** Advisory cancel of an in-flight query: [0x64][nonce:2] */ export declare const C2S_LSP_CANCEL = 100; /** Enumerate every live backend, daemon-wide: [0x65][nonce:2] */ export declare const C2S_LSP_SERVERS = 101; /** Shut one backend down by `server_ref`: [0x66][nonce:2][server_ref:2]. * A later query respawns it; observability before force. */ export declare const C2S_LSP_STOP = 102; /** Buffer overlay: [0x67][lsp_id:2][flags:1][path_len:2][path:N][text:LZ4]. * The full live buffer of an open editor (emitted-form path, like query * paths); while overlaid, the server engine's byte source for the * document is the overlay, not disk (docs/design/lsp.md "LSP_BUFFER"). * Flags bit 0 {@link LSP_BUFFER_RELEASE} drops the overlay (`text` * empty). No reply: idempotent last-writer-wins state on an ordered * transport. */ export declare const C2S_LSP_BUFFER = 103; /** Open outcome: [0x60][nonce:2][lsp_id:2][status:1][flags:1][root_len:2][root:N][detail_len:2][detail:N]. * On failure `lsp_id` = {@link LSP_ID_INVALID} and `detail` carries a * diagnostic; on success `root` is the canonical workspace root, escaped. */ export declare const S2C_LSP_OPENED = 96; /** Whole-state snapshot: [0x61][lsp_id:2][state_id:4][flags:1][records:LZ4]. * One `SERVER` record per live backend of the attachment. */ export declare const S2C_LSP_STATE = 97; /** Diagnostics update: [0x62][lsp_id:2][update_id:4][flags:1][records:LZ4]. * Per-file replacement sets; bit 0 {@link LSP_DIAG_FULL} carries the * complete workspace state (drop everything, then apply). */ export declare const S2C_LSP_DIAG = 98; /** Query response: [0x63][nonce:2][status:1][flags:1][detail_len:2][detail:N][records:LZ4]. * `detail` is a human-readable failure reason (empty on success). */ export declare const S2C_LSP_QUERY = 99; /** Attachment ended server-side: [0x64][lsp_id:2][reason:1] */ export declare const S2C_LSP_CLOSED = 100; /** Backend enumeration: [0x65][nonce:2][status:1][flags:1][records:LZ4]. * `SERVER` records as in `LSP_STATE` plus the escaped root. */ export declare const S2C_LSP_SERVERS = 101; /** Stop outcome: [0x66][nonce:2][status:1] */ export declare const S2C_LSP_STOPPED = 102; /** `S2C_HELLO` feature bit: server supports the `LSP_*` message family. */ export declare const FEATURE_LSP: number; export declare const LSP_STATUS_OK = 0; /** `lsp_id` unknown or already closed. */ export declare const LSP_STATUS_UNKNOWN_ID = 1; /** Path, symbol, or backend does not exist; discovery failures name the * missing binary in the detail field. */ export declare const LSP_STATUS_NOT_FOUND = 2; /** The element cannot answer this query (e.g. rename on a non-symbol). */ export declare const LSP_STATUS_WRONG_TYPE = 3; export declare const LSP_STATUS_PERMISSION = 4; /** Over a size cap; truncation flags cover the paginatable cases. */ export declare const LSP_STATUS_TOO_LARGE = 5; /** A budget was exhausted with no way to truncate. */ export declare const LSP_STATUS_BUDGET = 6; /** Malformed request (unknown flags, kind, or field combination). */ export declare const LSP_STATUS_INVALID = 7; /** Ended by `LSP_CANCEL`. */ export declare const LSP_STATUS_CANCELLED = 8; /** Diagnostic in the message's detail field where it has one. */ export declare const LSP_STATUS_OTHER = 9; /** The backing server has not finished initialize/indexing; retryable. */ export declare const LSP_STATUS_WARMING = 10; /** Human-readable name for an `LSP_STATUS_*` code. */ export declare function lspStatusText(status: number): string; /** Stream `LSP_STATE`. */ export declare const LSP_OPEN_WATCH: number; /** Stream `LSP_DIAG`; implies `WATCH`. */ export declare const LSP_OPEN_DIAGS: number; /** Resolve the workspace path from a pty's live cwd: a trailing * `[src_pty_id:2]` names a pty and the server joins `path` onto its cwd * before the root-marker walk (docs/ide.md Decision 3). */ export declare const LSP_OPEN_FROM_PTY: number; /** `lsp_id` value reporting an open failure. */ export declare const LSP_ID_INVALID = 65535; export declare const LSP_STREAM_STATE = 0; export declare const LSP_STREAM_DIAG = 1; /** → `LOCATION` records. */ export declare const LSP_QUERY_DEFINITION = 1; /** → `LOCATION` records; flags bit 0 {@link LSP_REFS_INCLUDE_DECLARATION}. */ export declare const LSP_QUERY_REFERENCES = 2; /** → one `MARKUP` record (plus an optional `LOCATION` for the range). */ export declare const LSP_QUERY_HOVER = 3; /** → `SYMBOL` records, pre-order; `line`/`col` ignored. */ export declare const LSP_QUERY_DOC_SYMBOLS = 4; /** → `SYMBOL` records; `path` empty, `arg` = query string. */ export declare const LSP_QUERY_WS_SYMBOLS = 5; /** → `EDIT` records; `arg` = new name. Data, never applied. */ export declare const LSP_QUERY_RENAME = 6; /** → `COMPLETION` records; the response's {@link LSP_RESP_INCOMPLETE} * flag mirrors the server's `isIncomplete` (retype should re-query). */ export declare const LSP_QUERY_COMPLETION = 7; /** → `SIGNATURE` records, active signature first. */ export declare const LSP_QUERY_SIGNATURE = 8; /** `REFERENCES`: include the declaration itself. */ export declare const LSP_REFS_INCLUDE_DECLARATION: number; /** Drop the overlay and revert the document to disk truth (`text` must * be empty). */ export declare const LSP_BUFFER_RELEASE: number; /** The update carries complete workspace diagnostic state: drop * everything, then apply. Every `DIAGS` subscribe begins with one (the * cache replay), and the server may send one at any time instead of an * incremental update. */ export declare const LSP_DIAG_FULL: number; /** The entries budget was hit; records present are valid. */ export declare const LSP_RESP_TRUNCATED: number; /** A `RENAME` plan dropped file operations it cannot project (create / * rename / delete of whole files in a `WorkspaceEdit`): the returned * `EDIT` records are the text edits only, so the plan is incomplete. */ export declare const LSP_RESP_INCOMPLETE: number; export declare const LSP_CLOSED_CLIENT_REQUEST = 0; export declare const LSP_CLOSED_ROOT_GONE = 1; export declare const LSP_CLOSED_PERMISSION_LOST = 2; export declare const LSP_CLOSED_BACKEND_FAILED = 3; export declare const LSP_CLOSED_RESOURCE_LIMIT = 4; /** Client-side pseudo-reason: the connection dropped or was re-established. * Attachments do not survive reconnects — re-`openLsp`. */ export declare const LSP_CLOSED_CONNECTION_LOST = -1; export declare const LSP_PHASE_SPAWNING = 0; export declare const LSP_PHASE_INITIALIZING = 1; export declare const LSP_PHASE_INDEXING = 2; export declare const LSP_PHASE_READY = 3; export declare const LSP_PHASE_FAILED = 4; /** `progress_pct` value when the backend reports no percentage. */ export declare const LSP_PROGRESS_UNKNOWN = 255; export declare const LSP_CAP_DEFINITION: number; export declare const LSP_CAP_REFERENCES: number; export declare const LSP_CAP_HOVER: number; export declare const LSP_CAP_DOC_SYMBOLS: number; export declare const LSP_CAP_WS_SYMBOLS: number; export declare const LSP_CAP_RENAME: number; export declare const LSP_CAP_COMPLETION: number; export declare const LSP_CAP_SIGNATURE: number; export declare const LSP_COMPLETION_DEPRECATED: number; /** `insert` is LSP snippet syntax; a client without snippet UI degrades * it to plain text. */ export declare const LSP_COMPLETION_SNIPPET: number; export declare const LSP_COMPLETION_PRESELECT: number; /** The active signature (emitted first). */ export declare const LSP_SIGNATURE_ACTIVE: number; /** `SIGNATURE.activeParam` value when no parameter is active. */ export declare const LSP_SIGNATURE_NO_PARAM = 65535; export declare const LSP_SEVERITY_ERROR = 1; export declare const LSP_SEVERITY_WARNING = 2; export declare const LSP_SEVERITY_INFO = 3; export declare const LSP_SEVERITY_HINT = 4; export declare const LSP_DIAG_UNNECESSARY: number; export declare const LSP_DIAG_DEPRECATED: number; export declare const LSP_MARKUP_PLAIN = 0; export declare const LSP_MARKUP_MARKDOWN = 1; export declare const LSP_SYMBOL_DEPRECATED: number; export declare const LSP_STATE_RECORD_SERVER = 1; export declare const LSP_DIAG_RECORD_FILE = 1; export declare const LSP_DIAG_RECORD_DIAG = 2; export declare const LSP_QUERY_RECORD_LOCATION = 1; export declare const LSP_QUERY_RECORD_MARKUP = 2; export declare const LSP_QUERY_RECORD_SYMBOL = 3; export declare const LSP_QUERY_RECORD_EDIT = 4; export declare const LSP_QUERY_RECORD_COMPLETION = 5; export declare const LSP_QUERY_RECORD_SIGNATURE = 6; /** BLAKE3 truncated to 128 bits, as in the fs family: the content * version a record describes. Always 16 bytes on the wire. */ export type LspHash = Uint8Array; /** The all-zero hash: content version unknown. */ export declare const LSP_HASH_NONE: LspHash; export declare function msgLspOpen(nonce: number, flags: number, diagLatencyMs: number, path: string, srcPtyId?: number): Uint8Array; export declare function msgLspClose(lspId: number): Uint8Array; export declare function msgLspAck(lspId: number, stream: number, updateId: number): Uint8Array; export interface LspQueryRequest { nonce: number; lspId: number; /** One of `LSP_QUERY_*`. */ kind: number; flags: number; /** 0-based; ignored by the symbol kinds. */ line: number; /** UTF-8 byte offset within the line; ignored by the symbol kinds. */ col: number; /** Escaped form; empty for `WS_SYMBOLS`. */ path: string; /** `WS_SYMBOLS` query string or `RENAME` new name; empty otherwise. */ arg: string; } export declare function msgLspQuery(req: LspQueryRequest): Uint8Array; export declare function msgLspCancel(nonce: number): Uint8Array; export declare function msgLspServers(nonce: number): Uint8Array; export declare function msgLspStop(nonce: number, serverRef: number): Uint8Array; /** Build a `C2S_LSP_BUFFER`: `text` is the full buffer content, * LZ4-compressed on the wire. A {@link LSP_BUFFER_RELEASE} must carry * empty `text`. */ export declare function msgLspBuffer(lspId: number, flags: number, path: string, text: Uint8Array): Uint8Array; /** Parse `C2S_LSP_BUFFER` into `[lspId, flags, path, text]` with the * text decompressed (tests and mocks; the server is the consumer). */ export declare function parseLspBuffer(msg: Uint8Array): [number, number, string, Uint8Array] | null; /** A decoded `S2C_LSP_OPENED`. */ export interface LspOpened { nonce: number; lspId: number; status: number; flags: number; /** Escaped canonical workspace root; empty on failure. */ root: string; /** Diagnostic on failure. */ detail: string; } export declare function parseLspOpened(msg: Uint8Array): LspOpened | null; /** Parse `S2C_LSP_STATE` into `[lspId, stateId, flags, records]` with the * records decompressed. */ export declare function parseLspState(msg: Uint8Array): [number, number, number, Uint8Array] | null; /** Parse `S2C_LSP_DIAG` into `[lspId, updateId, flags, records]` with the * records decompressed. */ export declare function parseLspDiag(msg: Uint8Array): [number, number, number, Uint8Array] | null; /** Parse `S2C_LSP_QUERY` into `[nonce, status, flags, detail, records]` * with the records decompressed. */ export declare function parseLspQueryResp(msg: Uint8Array): [number, number, number, string, Uint8Array] | null; export declare function parseLspServersResp(msg: Uint8Array): [number, number, number, Uint8Array] | null; /** Parse `S2C_LSP_CLOSED` into `[lspId, reason]`. */ export declare function parseLspClosed(msg: Uint8Array): [number, number] | null; /** Parse `S2C_LSP_STOPPED` into `[nonce, status]`. */ export declare function parseLspStopped(msg: Uint8Array): [number, number] | null; export declare function msgLspOpened(nonce: number, lspId: number, status: number, flags: number, root: string, detail: string): Uint8Array; export declare function msgLspState(lspId: number, stateId: number, flags: number, records: Uint8Array): Uint8Array; export declare function msgLspDiag(lspId: number, updateId: number, flags: number, records: Uint8Array): Uint8Array; export declare function msgLspQueryResp(nonce: number, status: number, flags: number, detail: string, records: Uint8Array): Uint8Array; export declare function msgLspServersResp(nonce: number, status: number, flags: number, records: Uint8Array): Uint8Array; export declare function msgLspClosed(lspId: number, reason: number): Uint8Array; export declare function msgLspStopped(nonce: number, status: number): Uint8Array; /** SERVER 0x01: [kind:1][server_ref:2][phase:1][progress_pct:1][caps:4] * [epoch:4][refused_edits:4][rss:8][id_len:2][id:N][msg_len:2][msg:N] */ export type LspStateRecord = { kind: "server"; /** Daemon-scoped backend id (`LSP_STOP` target). */ serverRef: number; /** One of `LSP_PHASE_*`. */ phase: number; /** 0-100, or {@link LSP_PROGRESS_UNKNOWN}. */ progressPct: number; /** `LSP_CAP_*` bits. */ caps: number; /** Increments on dynamic capability (re)registration. */ epoch: number; /** `workspace/applyEdit` requests answered `applied:false`. */ refusedEdits: number; /** Best-effort resident set size in bytes; 0n = unknown. */ rss: bigint; /** Server id from the discovery table (e.g. `rust-analyzer`). */ id: string; /** Last progress or showMessage line. */ msg: string; }; /** SERVER 0x01: the `LSP_STATE` layout + [root_len:2][root:N] */ export type LspServersRecord = LspStateRecord & { /** Escaped canonical workspace root. */ root: string; }; export type LspDiagRecord = /** FILE 0x01: [kind:1][hash:16][n:2][path_len:2][path:N]. * Replaces the file's entire diagnostic set (the following `n` diag * records); `n` = 0 clears. `hash` names the content version the set * describes; zero when unknown. */ { kind: "file"; hash: LspHash; n: number; path: string; } /** DIAG 0x02: [kind:1][severity:1][flags:1][line:4][col:4][end_line:4][end_col:4] * [code_len:2][code:N][src_len:2][source:N][msg_len:4][msg:N] */ | { kind: "diag"; /** One of `LSP_SEVERITY_*`. */ severity: number; /** {@link LSP_DIAG_UNNECESSARY} / {@link LSP_DIAG_DEPRECATED}. */ flags: number; line: number; col: number; endLine: number; endCol: number; code: string; /** The producing backend (e.g. `rust-analyzer`, `clippy`). */ source: string; msg: string; }; export type LspQueryRecord = /** LOCATION 0x01: [kind:1][flags:1][hash:16][line:4][col:4][end_line:4][end_col:4][path_len:2][path:N] */ { kind: "location"; flags: number; /** Content version the location refers into; zero when unknown. */ hash: LspHash; line: number; col: number; endLine: number; endCol: number; path: string; } /** MARKUP 0x02: [kind:1][format:1][text_len:4][text:N] */ | { kind: "markup"; /** {@link LSP_MARKUP_PLAIN} or {@link LSP_MARKUP_MARKDOWN}. */ format: number; text: string; } /** SYMBOL 0x03: [kind:1][sym_kind:1][flags:1][depth:1][line:4][col:4] * [end_line:4][end_col:4][name_len:2][name:N][path_len:2][path:N]. * `depth` nests document outlines (pre-order); 0 at the top level. */ | { kind: "symbol"; /** LSP SymbolKind value. */ symKind: number; /** {@link LSP_SYMBOL_DEPRECATED}. */ flags: number; depth: number; line: number; col: number; endLine: number; endCol: number; name: string; path: string; } /** EDIT 0x04: [kind:1][flags:1][hash:16][line:4][col:4][end_line:4][end_col:4] * [new_len:4][new_text:N][path_len:2][path:N]. * One ordered edit of a rename plan, against the content version named * by `hash`. Data, never applied. */ | { kind: "edit"; flags: number; hash: LspHash; line: number; col: number; endLine: number; endCol: number; newText: string; path: string; } /** COMPLETION 0x05: [kind:1][item_kind:1][flags:1][line:4][col:4] * [end_line:4][end_col:4][label_len:2][label:N][insert_len:2][insert:N] * [detail_len:2][detail:N]. * The range is the item's primary replace range (zero range → the * client picks its own word boundary); empty `insert` → insert the * label. */ | { kind: "completion"; /** LSP CompletionItemKind value; 0 unknown. */ itemKind: number; /** `LSP_COMPLETION_*` bits. */ flags: number; line: number; col: number; endLine: number; endCol: number; label: string; insert: string; detail: string; } /** SIGNATURE 0x06: [kind:1][flags:1][active_param:2][param_start:2] * [param_end:2][label_len:2][label:N][doc_len:4][doc:N]. * One signature, the active one first ({@link LSP_SIGNATURE_ACTIVE}); * `paramStart`/`paramEnd` bound the active parameter within `label` * in UTF-8 bytes (0,0 = unknown). */ | { kind: "signature"; /** `LSP_SIGNATURE_*` bits. */ flags: number; /** Active parameter index, or {@link LSP_SIGNATURE_NO_PARAM}. */ activeParam: number; paramStart: number; paramEnd: number; label: string; doc: string; }; /** Iterate records in an uncompressed `LSP_STATE` payload. */ export declare function lspStateRecords(data: Uint8Array): Generator; /** Iterate records in an uncompressed `LSP_SERVERS` payload. */ export declare function lspServersRecords(data: Uint8Array): Generator; /** Iterate records in an uncompressed `LSP_DIAG` payload. */ export declare function lspDiagRecords(data: Uint8Array): Generator; /** Iterate records in an uncompressed `LSP_QUERY` response payload. */ export declare function lspQueryRecords(data: Uint8Array): Generator; /** Append one record to an uncompressed `LSP_STATE` records buffer. */ export declare function appendLspStateRecord(buf: number[], record: LspStateRecord): void; /** Append one record to an uncompressed `LSP_SERVERS` records buffer. */ export declare function appendLspServersRecord(buf: number[], record: LspServersRecord): void; /** Append one record to an uncompressed `LSP_DIAG` records buffer. */ export declare function appendLspDiagRecord(buf: number[], record: LspDiagRecord): void; /** Append one record to an uncompressed `LSP_QUERY` response buffer. */ export declare function appendLspQueryRecord(buf: number[], record: LspQueryRecord): void; export interface LspOpenOptions { /** Stream `LSP_STATE` snapshots. */ watch?: boolean; /** Stream `LSP_DIAG` replacement sets (implies watch). */ diagnostics?: boolean; /** Diagnostics settle window in ms; 0 = server default (500). */ diagLatencyMs?: number; /** A state snapshot was applied and acknowledged. */ onState?: (mirror: LspStateMirror, stateId: number) => void; /** A diagnostics update was applied and acknowledged. */ onDiagnostics?: (mirror: LspDiagMirror, updateId: number) => void; /** The attachment ended: an `LSP_CLOSED` reason, or * {@link LSP_CLOSED_CONNECTION_LOST} when the connection dropped. */ onClosed?: (reason: number) => void; /** Resolve the workspace path from this session's live cwd, so intelligence * follows `cd` (docs/ide.md Decision 3). The session must be on the same * connection. */ fromSessionId?: SessionId; } /** One query's outcome. Non-OK statuses resolve (WARMING is retryable); * only connection loss rejects. */ export interface LspQueryResult { /** An `LSP_STATUS_*` code; inspect before reading records. */ status: number; /** A human-readable failure reason (e.g. the upstream server's own * error message on a non-OK status); empty on success. */ detail: string; /** The entries budget was hit; records present are valid. */ truncated: boolean; /** A `RENAME` plan dropped file operations it cannot project (create / * rename / delete of whole files in a `WorkspaceEdit`): the returned * `EDIT` records are the text edits only, so the plan is incomplete. */ incomplete: boolean; records: LspQueryRecord[]; } /** A workspace attachment opened by `BlitConnection.openLsp`. */ export interface LspHandle extends ReactiveStore { readonly lspId: number; /** Escaped canonical workspace root. */ readonly root: string; /** Live backend state; populated when watching. Replaced wholesale per * snapshot. */ readonly state: LspStateMirror; /** Live diagnostics; populated when subscribed. Per-file replacement * sets; absence of a path means unknown, not clean. */ readonly diags: LspDiagMirror; /** Definition of the symbol at a position → `location` records. */ definition(path: string, line: number, col: number): Promise; /** References to the symbol at a position → `location` records. */ references(path: string, line: number, col: number, includeDeclaration?: boolean): Promise; /** Hover at a position → one `markup` record (plus an optional * `location` for the range). */ hover(path: string, line: number, col: number): Promise; /** Document outline → `symbol` records, pre-order. */ documentSymbols(path: string): Promise; /** Workspace-wide symbol search → `symbol` records. */ workspaceSymbols(query: string): Promise; /** Rename plan → ordered `edit` records. Data, never applied. */ rename(path: string, line: number, col: number, newName: string): Promise; /** Completion at a position → `completion` records in the server's * ranking order; `incomplete` mirrors `isIncomplete` (retype should * re-query). */ completion(path: string, line: number, col: number): Promise; /** Signature help at a position → `signature` records, active first. */ signatureHelp(path: string, line: number, col: number): Promise; /** Stream this document's live buffer as its LSP byte source * (docs/design/lsp.md "LSP_BUFFER"). Full text, last-writer-wins, * fire-and-forget: send debounced on edits and flush before queries — * transport ordering makes the query answer against these bytes. */ buffer(path: string, text: Uint8Array): void; /** Drop the overlay: the document reverts to disk truth. (Closing the * attachment or losing the connection releases implicitly.) */ releaseBuffer(path: string): void; /** Release the attachment (backends stay warm); `onClosed` fires when * the server confirms. */ close(): void; } /** One backend's projected state, from a `SERVER` record. */ export interface LspServerState { phase: number; progressPct: number; caps: number; epoch: number; refusedEdits: number; rss: bigint; id: string; msg: string; } /** * The complete client obligation for `LSP_STATE`: replace the whole map, * acknowledge the returned id. */ export declare class LspStateMirror { /** Keyed by `server_ref`. */ servers: Map; /** The last snapshot's flags. */ flags: number; /** Apply one `S2C_LSP_STATE` message (starting at the opcode byte), * replacing the whole state. Returns the `state_id` to ack, or null * when malformed. */ applyState(msg: Uint8Array): number | null; } /** One diagnostic, owned, from a `diag` record. */ export interface LspDiagnostic { severity: number; flags: number; line: number; col: number; endLine: number; endCol: number; code: string; source: string; msg: string; } /** One file's diagnostic set. */ export interface LspFileDiags { /** Content version the set describes; zero when unknown. */ hash: LspHash; diags: LspDiagnostic[]; } /** * The complete client obligation for `LSP_DIAG`: apply per-file * replacement sets, acknowledge. Absence of a path means unknown, not * clean. */ export declare class LspDiagMirror { /** Keyed by escaped workspace-relative path. */ files: Map; /** Apply one `S2C_LSP_DIAG` message (starting at the opcode byte). * Returns the `update_id` to ack, or null when malformed. */ applyDiag(msg: Uint8Array): number | null; } //# sourceMappingURL=lsp.d.ts.map