Closed gitonthescene closed 8 months ago
Ah, it looks like the lsp-devtools record
command isn't handling the default --to-file
case correctly.
There is a potential workaround, you could try setting a format string e.g. lsp-devtools record -f "{.params}" --to-file example.json
. It will have the benefit of writing out valid JSON, at the expense of filtering out all the data that does not fit the pattern.
Hopefully, I will be able to make a release containing a fix soonTM but in testing this I've spotted a few other bugs that are worth fixing... :sweat_smile:
Thanks for getting back so quickly. I’m not in a rush. I just wanted to flag it.
Awesome! Thanks!
No worries! lsp-devtools v0.2.2
is now out with this fix included, let me know if you run into any issues! :)
FWIW, the sample data from the documentation still has Python object format instead of json.
I did test that it v0.2.2
does produce json though. Thanks again.
When using
lsp-devtools record --to-file example.json
the output seems to be formatted as Python objects rather than proper json making it hard to use 3rd party tools like jq to examine the output.Is there any reason not to use
json.dumps()
here? Or if it's optional, would it make sense to make json the default?I see this in the code, but looking at the doc it's not clear to me how to simply format the output as json. Perhaps this line should be higher up in this function?
Here's a typical line of output I'm seeing: