Unfortunately I cannot share the file I am working on but it should be easily reproduced on any randomly-generated JSON that is sufficiently large (input size ~30MB, output size ~300KB).
Thanks for the extension, it's really great, but would appreciate fixing this as it renders the whole thing broken for large files.
Large output contains additional commas, resulting in malformed JSON.
The cause for this which I have identified is incorrect assembling of the command line stdout:
on line https://github.com/davidnussio/vscode-jq-playground/blob/8f25f3afb22475332b1168daa4a76d32749c55aa/src/command-line.ts#L156
result.stdout
(which is an array of buffers) is passed tores
, but later on, in lines https://github.com/davidnussio/vscode-jq-playground/blob/8f25f3afb22475332b1168daa4a76d32749c55aa/src/extension.ts#L367 or https://github.com/davidnussio/vscode-jq-playground/blob/8f25f3afb22475332b1168daa4a76d32749c55aa/src/extension.ts#L371 that array is passed tobufferToString
which simply calls.toString()
on the argument. This results in the array elements being joined by commas. This would not be visible for short test outputs as the array would usually only have one element.Unfortunately I cannot share the file I am working on but it should be easily reproduced on any randomly-generated JSON that is sufficiently large (input size ~30MB, output size ~300KB).
Thanks for the extension, it's really great, but would appreciate fixing this as it renders the whole thing broken for large files.