Add Grace_json_renderer - #84
Conversation
There was a problem hiding this comment.
I'd prefer to avoid duplicating test data (we should probably start putting these code snippets in dedicated files anyway), but that can be done in a separate PR :)
|
@johnyob thanks for the comments. I took all your suggestions minus the deduplication of tests for now. |
johnyob
left a comment
There was a problem hiding this comment.
lgtm 🚀
Seems like you need to make CI happy (likely your commit message format). After that we can merge :)
255a377 to
b5542ff
Compare
|
Thanks @johnyob -- I squashed everything into one |
|
One thing I would like to raise is that AFAIK major language clients, such as that of Visual Studio Code, only properly support UTF-16 offsets. So integrating Grace with the language server protocol will in practice require switching to UTF-16 offsets, because VS Code is the de facto 'canonical' instance of LSP. Does it seem like there is a chance of making this change, or of at least providing this option? /cc @kentookura. |
CHANGES: - feat(renderer): add boxing to trailing labels ([johnyob/grace#92](johnyob/grace#92)) - fix(renderer): print unicode and ansi-styled snippets as correct lengths ([johnyob/grace#88](johnyob/grace#88)) - feat(renderer): add boxing to multi-line labels ([johnyob/grace#88](johnyob/grace#88)) - feat(json_conv): use `Yojson.Basic.t` ([johnyob/grace#87](johnyob/grace#87)) - feat(json_conv): add `Grace_json_conv` for conversion to Yojson ([johnyob/grace#84](johnyob/grace#84)) - fix(core): dont catch `Sys_error` in `Source.length` if the fail doesn't exist ([johnyob/grace#81](johnyob/grace#81)) - feat(renderer): support configurable contextual lines ([johnyob/grace#74](johnyob/grace#74))
CHANGES: - feat(renderer): add boxing to trailing labels ([johnyob/grace#92](johnyob/grace#92)) - fix(renderer): print unicode and ansi-styled snippets as correct lengths ([johnyob/grace#88](johnyob/grace#88)) - feat(renderer): add boxing to multi-line labels ([johnyob/grace#88](johnyob/grace#88)) - feat(json_conv): use `Yojson.Basic.t` ([johnyob/grace#87](johnyob/grace#87)) - feat(json_conv): add `Grace_json_conv` for conversion to Yojson ([johnyob/grace#84](johnyob/grace#84)) - fix(core): dont catch `Sys_error` in `Source.length` if the fail doesn't exist ([johnyob/grace#81](johnyob/grace#81)) - feat(renderer): support configurable contextual lines ([johnyob/grace#74](johnyob/grace#74))
CHANGES: - feat(renderer): add boxing to trailing labels ([johnyob/grace#92](johnyob/grace#92)) - fix(renderer): print unicode and ansi-styled snippets as correct lengths ([johnyob/grace#88](johnyob/grace#88)) - feat(renderer): add boxing to multi-line labels ([johnyob/grace#88](johnyob/grace#88)) - feat(json_conv): use `Yojson.Basic.t` ([johnyob/grace#87](johnyob/grace#87)) - feat(json_conv): add `Grace_json_conv` for conversion to Yojson ([johnyob/grace#84](johnyob/grace#84)) - fix(core): dont catch `Sys_error` in `Source.length` if the fail doesn't exist ([johnyob/grace#81](johnyob/grace#81)) - feat(renderer): support configurable contextual lines ([johnyob/grace#74](johnyob/grace#74))
Closes #82.
For testing, I am re-using the ansi renderer tests to a large degree. Obviously they could be simplified, since the edge cases are much more limited in this renderer.
Example: