Add Diagnostic and related types#9
Merged
Merged
Conversation
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
added a commit
that referenced
this pull request
Jul 7, 2026
Add Diagnostic and related types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
Diagnosticper LSP 3.17 — Diagnostic, together with every supporting type the spec requires.Changes
New Pydantic models in
lsp_client/protocol.py:Diagnostic—range+message(required); optionalseverity,code(integer | string),codeDescription,source,tags,relatedInformation, anddata.DiagnosticSeverity—IntEnum:Error=1,Warning=2,Information=3,Hint=4.DiagnosticTag—IntEnum:Unnecessary=1,Deprecated=2(@SInCE 3.15.0).CodeDescription—hrefURI (@SInCE 3.16.0).DiagnosticRelatedInformation—location+message.Location—uri+range(a basic structure thatDiagnosticRelatedInformationdepends on; not previously present).All new names are exported from
lsp_client.Testing
Locationstructure, minimalDiagnostic(only required fields serialised), a fully-populatedDiagnosticwith nested related information, integercode, and rejection of an invalid severity.poetry run pytest(66 passed),ruff check,ruff format --check, andmypyall clean.🤖 Generated with Claude Code