Emit the full span range in beloch:edges provenance #49

Open
opened 2026-07-03 18:26:50 +00:00 by toph · 0 comments
Owner

Currently each beloch:edges entry serializes only the span startspan_to_string keeps (start, _) and drops the end (lib/error.ml:9), so span reads e.g. through.bel:3:1: a point, not a range.

The provenance record already carries the full range (Error.span = start, end; lib/state.ml:7), so nothing new needs to be tracked — only serialized. Emitting both ends gives editor tooling, notably the VS Code live preview (#38-ish preview work), enough to highlight the exact operation that produced a crease on hover, instead of jumping to its first character.

Open question: wire format. Either extend the string (through.bel:3:1-3:19) or emit a structured { "start": [l,c], "end": [l,c] }. Structured is friendlier for the editor consumer; the string stays greppable. Lean structured unless the CLI use of span wants to stay a one-liner.

  • Serialize start and end in the beloch:edges span field
  • Regenerate the golden .fold fixtures
  • Update SPECIFICATION.md §7 to document the span shape
Currently each `beloch:edges` entry serializes only the span **start** — `span_to_string` keeps `(start, _)` and drops the end (`lib/error.ml:9`), so `span` reads e.g. `through.bel:3:1`: a point, not a range. The provenance record already carries the full range (`Error.span = start, end`; `lib/state.ml:7`), so nothing new needs to be tracked — only serialized. Emitting both ends gives editor tooling, notably the VS Code live preview (#38-ish preview work), enough to highlight the exact operation that produced a crease on hover, instead of jumping to its first character. Open question: wire format. Either extend the string (`through.bel:3:1-3:19`) or emit a structured `{ "start": [l,c], "end": [l,c] }`. Structured is friendlier for the editor consumer; the string stays greppable. Lean structured unless the CLI use of `span` wants to stay a one-liner. - [ ] Serialize start and end in the `beloch:edges` `span` field - [ ] Regenerate the golden `.fold` fixtures - [ ] Update SPECIFICATION.md §7 to document the span shape
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
toph/beloch#49
No description provided.