Skip to content

Allow array params on notification messages#8

Merged
christiankissig merged 1 commit into
masterfrom
add-notification-message
Jun 3, 2026
Merged

Allow array params on notification messages#8
christiankissig merged 1 commit into
masterfrom
add-notification-message

Conversation

@christiankissig

Copy link
Copy Markdown
Owner

Summary

Implements NotificationMessage per LSP 3.17 — Notification Message.

The spec defines a notification as Message + method: string + params?: array | object. BaseNotification (aliased as NotificationMessage) typed params as dict | None, so it could not carry array params, which the spec explicitly allows.

Changes

  • Widen BaseNotification.params from dict | None to list | dict | None.
  • Document BaseNotification per the spec (no response is sent back; params may be an array or an object).

This is backward compatible — existing object (dict) params and the concrete notification subclasses are unaffected.

Testing

  • 4 new tests: object params, array params, optional params (omitted when absent), and method required.
  • poetry run pytest (59 passed), ruff check, ruff format --check, and mypy all clean.

Note: the request message (BaseRequest) has the same params?: array | object shape in the spec and is still typed dict | None; I left it untouched to keep this PR scoped to notifications — happy to widen it in a follow-up if desired.

🤖 Generated with Claude Code

Per the LSP notificationMessage spec, a notification's params may be
either an array or an object (params?: array | object). BaseNotification
typed params as dict | None, so it could not carry array params. Widen
it to list | dict | None and document the type per spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christiankissig christiankissig merged commit 4000546 into master Jun 3, 2026
5 checks passed
@christiankissig christiankissig deleted the add-notification-message branch June 3, 2026 18:59
christiankissig added a commit that referenced this pull request Jul 7, 2026
Allow array params on notification messages
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