Skip to content

Add Diagnostic and related types#9

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

Add Diagnostic and related types#9
christiankissig merged 1 commit into
masterfrom
add-diagnostic

Conversation

@christiankissig

Copy link
Copy Markdown
Owner

Summary

Implements Diagnostic per LSP 3.17 — Diagnostic, together with every supporting type the spec requires.

Changes

New Pydantic models in lsp_client/protocol.py:

  • Diagnosticrange + message (required); optional severity, code (integer | string), codeDescription, source, tags, relatedInformation, and data.
  • DiagnosticSeverityIntEnum: Error=1, Warning=2, Information=3, Hint=4.
  • DiagnosticTagIntEnum: Unnecessary=1, Deprecated=2 (@SInCE 3.15.0).
  • CodeDescriptionhref URI (@SInCE 3.16.0).
  • DiagnosticRelatedInformationlocation + message.
  • Locationuri + range (a basic structure that DiagnosticRelatedInformation depends on; not previously present).

All new names are exported from lsp_client.

Testing

  • 9 new tests: severity/tag enum values, Location structure, minimal Diagnostic (only required fields serialised), a fully-populated Diagnostic with nested related information, integer code, and rejection of an invalid severity.
  • poetry run pytest (66 passed), ruff check, ruff format --check, and mypy all clean.

🤖 Generated with Claude Code

Implement the Diagnostic structure from the LSP spec along with its
supporting types: DiagnosticSeverity, DiagnosticTag, CodeDescription,
DiagnosticRelatedInformation, and the Location type it depends on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@christiankissig christiankissig merged commit cfead5d into master Jun 3, 2026
5 checks passed
@christiankissig christiankissig deleted the add-diagnostic branch June 3, 2026 19:02
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