You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mock provider panics on a position in the phantom last line of newline-terminated documents #63
puzzle/text.rs:49-75 — line_starts appends a phantom empty line after a trailing \n; line_byte_range then strips \r\n/\n from that already-empty line, producing an inverted start > end range, and line_text slices it -> panic (exit 101).
Reachable via any positioned method: lpp/definition, lpp/references, lpp/rename, lpp/validateEdits. {line: last, character: 0} is a valid position per spec 6.4.
Reproduction
printf'%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"lpp/initialize","params":{"protocolVersion":"1.0"}}' \
'{"jsonrpc":"2.0","id":2,"method":"lpp/validateEdits","params":{"document":{"uri":"file:///a.xdl","languageId":"x-demo-lang","version":1,"text":"puzzle p {\n target = 1\n start = 0\n ops {\n a: x => x + 1\n }\n solution = [ a ]\n}\n"},"edits":[{"range":{"start":{"line":8,"character":0},"end":{"line":8,"character":0}},"newText":"//"}]}}' \
| ./target/release/lpp-mock-provider # panics: byte range starts at 87 but ends at 86
Acceptance criteria
Positions on the phantom last line return invalidPosition or a normal result; never a panic.
Activity
e54-bot commentedon Oct 15, 2026
Fixed in #86 (commit 15015bc).