Skip to content

LSP: window messages, progress, trace (specs/lsp/window.t27) #12245

Closed

Description

@gHashTag

The window features of the protocol: tell the user something, ask them something, show progress, open a document, log, trace. A server that works but never reports progress looks frozen in the editor. Part of the LSP epic, Refs #12209 (wave 1, standard features). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.

Depends on specs/lsp/transport.t27 (sending requests and notifications) and specs/lsp/lifecycle.t27 (capabilities).

Prior art:

Boundary

  • specs/lsp/window.t27

User Scenarios

  • Given the workspace index takes a while, when it starts, then the server sends window/workDoneProgress/create with a token, then $/progress begin (title Indexing), report events with percentage and message (41/230 specs), and end.
  • Given the user presses the cancel button on a progress item, when window/workDoneProgress/cancel arrives, then the matching job stops at its next check and sends end with the message cancelled.
  • Given a client without workDoneProgress, when the same job runs, then the server sends nothing on that channel and logs through window/logMessage instead.
  • Given the server needs a choice, when it sends window/showMessageRequest with 2 actions, then the answer selects one or is null, and null is treated as cancel.
  • Given a command wants to open a generated view, when it runs, then the server sends window/showDocument with external false and takeFocus as asked, and handles success false.
  • Given $/setTrace verbose, when a request is handled, then $/logTrace carries the message and verbose detail; at off nothing is sent.

Requirements

  • FR-001: The module MUST provide a progress helper (create, begin, report, end, cancelled) usable by every other module, with unique tokens, and MUST support partialResult and workDone tokens that arrive in requests.
  • FR-002: The module MUST implement showMessage, showMessageRequest, logMessage, showDocument, setTrace, logTrace and telemetry/event, each gated on the capability or the trace level.
  • FR-003: Message levels MUST map to one table (Error, Warning, Info, Log), and the minimum level to log is a setting.
  • FR-004: A cancelled job MUST always send end; a test asserts that no token is left open after cancel, error or completion.
  • FR-005: Telemetry MUST be off by default and MUST send nothing unless a setting names it; a test asserts the default.

Success Criteria

  • At least 20 tests in specs/lsp/window.t27 pass, run on the lab with t27c test-report (exit 0), including the open-token check.
  • A negative control runs the progress helper against a client with no progress support and asserts 0 progress messages were produced.
  • git diff --name-only master lists only specs/lsp/window.t27 (0 files in other languages).

Activity

  1. gHashTag commented on Nov 17, 2026

    @gHashTag
    CollaboratorAuthor

    LSP spec created (typecheck OK, tests pass).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/specs.t27 spec files and conformanceenhancementNew feature or requestspec

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions