Skip to content

Conversation

@ryo33
Copy link
Member

@ryo33 ryo33 commented Jan 6, 2026

Allow specifying expected diagnostic spans using exact text strings
instead of byte offsets. This makes tests more readable and maintainable.

Changes:

  • Add span field to DiagnosticItem (optional string)
  • When span is specified, resolve it to byte offsets by searching
    the editor content for an exact match
  • Error if span string not found or found multiple times (ambiguous)
  • Existing start/end fields still work for edge cases where span
    string would be ambiguous
  • Update 3 test cases to use the new span syntax

claude added 2 commits January 6, 2026 01:54
Allow specifying expected diagnostic spans using exact text strings
instead of byte offsets. This makes tests more readable and maintainable.

Changes:
- Add `span` field to DiagnosticItem (optional string)
- When `span` is specified, resolve it to byte offsets by searching
  the editor content for an exact match
- Error if span string not found or found multiple times (ambiguous)
- Existing start/end fields still work for edge cases where span
  string would be ambiguous
- Update 3 test cases to use the new span syntax
Test cases:
- Found once (normal case)
- At start of content
- At end of content
- Not found (error)
- Ambiguous (multiple matches, error)
- With quotes (real-world case)
@ryo33 ryo33 merged commit e0f6989 into main Jan 6, 2026
1 check passed
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.

3 participants