Closed
Description
This surfaced at rust-lang/rls#1463 (fixed in rust-lang/rls#1497).
The underlying data structure discerns a missing/"all" state in addition to actual set (possibly empty) of lines:
rustfmt/src/config/file_lines.rs
Lines 151 to 157 in 26d370e
whereas to_json_span
only encodes a specified set of those changes (can't represent FileLines(None)
):
rustfmt/src/config/file_lines.rs
Lines 218 to 221 in 26d370e
I think we should either:
- panic/return err on
None
match into_json_spans
(sincevec![]
returned forFileLines(None)
won't be parsed back into theFileLines(None)
but ratherFileLines(Some(HashMap::new))
- Somehow discern or accept
null
lines in--file-lines JSON
and maketo_json_spans()
returnOption<Vec<JsonSpan>>
Thoughts?