Skip to content

Add InitializeResult and ServerInfo#10

Merged
christiankissig merged 1 commit into
masterfrom
add-initialize-result
Jun 3, 2026
Merged

Add InitializeResult and ServerInfo#10
christiankissig merged 1 commit into
masterfrom
add-initialize-result

Conversation

@christiankissig

Copy link
Copy Markdown
Owner

Summary

Implements InitializeResult per LSP 3.17 — Initialize — the result a server returns from the initialize request.

Changes

New Pydantic models in lsp_client/protocol.py:

  • InitializeResultcapabilities: ServerCapabilities (required) plus an optional serverInfo.
  • ServerInfo — the serverInfo object: name (required) and optional version (@SInCE 3.15.0).

Both are exported from lsp_client. InitializeResult.capabilities reuses the existing ServerCapabilities model.

Testing

  • 5 new tests: minimal result (only capabilities, serverInfo omitted), result with full serverInfo, optional version, name required, and parsing a raw server response payload into the nested models (InitializeResult.model_validate(...)).
  • poetry run pytest (71 passed), ruff check, ruff format --check, and mypy all clean.

Note: the initialize section also defines InitializeError ({ retry: boolean }); left out to keep this PR scoped to InitializeResult — happy to add it in a follow-up.

🤖 Generated with Claude Code

Implement the InitializeResult returned from an initialize request per
the LSP spec: capabilities (ServerCapabilities) plus an optional
serverInfo (name and optional version), modelled as ServerInfo.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christiankissig christiankissig merged commit 57ffdd9 into master Jun 3, 2026
5 checks passed
@christiankissig christiankissig deleted the add-initialize-result branch June 3, 2026 19:04
christiankissig added a commit that referenced this pull request Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant