davidnussio / vscode-jq-playground

Visual Code Studio jq playground
https://marketplace.visualstudio.com/items?itemName=davidnussio.vscode-jq-playground
MIT License
46 stars 8 forks source link

extension.executeJqCommand failed #60

Closed jeffabailey closed 4 years ago

jeffabailey commented 4 years ago

I am receiving this error after installing this extension on macOS Mojave 10.14.6 and VSCode Version: 1.50.1.

extension.executeJqCommand failed

image

davidnussio commented 4 years ago

Could you verify if the jq binary exists in vscode globalStorage? (MacOs would be the dir ~/Library/Application Support/Code/User/globalStorage/davidnussio.vscode-jq-playground)

If it exists, does the OS let you exec this file?

Are you behind a proxy? (see #25 )

It is possible to use system installed jq binary: vscode → preferences → settings → jq path

jeffabailey commented 4 years ago

I see it here, but not in the path you specified.

`'/Users/jeffbailey/Library/Application Support/Code/User/globalStorage/davidnussio.vscode-jq-playground/jq' -h jq - commandline JSON processor [version 1.6]

Usage: /Users/jeffbailey/Library/Application Support/Code/User/globalStorage/davidnussio.vscode-jq-playground/jq [options] [file...] /Users/jeffbailey/Library/Application Support/Code/User/globalStorage/davidnussio.vscode-jq-playground/jq [options] --args [strings...]`

It does allow execution as illustrate.

Here is the output of the successful installation the binary.

image

I am running the extension on both macOS Mohave and macOS Catalina and I'm seeing the same issue.

I did try to use the system installed jq binary as well, and I get get the same error.

Here is a video of a run of the extension using the /usr/local/bin/jq binary installed by Homebrew on Catalina.

https://www.loom.com/share/5963fe03e0724a92abcbfba81eab4231?from_recorder=1

davidnussio commented 4 years ago

In the video there is the query jq . but is missing the data on the second line.

Test it with:

jq '.'
{}

Or try open examples (cmd + shift + p → jq examples), execute them and tell me if it works.

jeffabailey commented 4 years ago

Aha, that worked.

I didn't see a syntax error, so it wasn't clear that syntax was the issue.

Thanks, great extension, this will save me a huge amount of time!

davidnussio commented 4 years ago

the error was not clear to me either, with the next release I will try to improve the message. 😬😀