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

Other options OK, but jq -c seems to confuse the parser #52

Closed lleeoo closed 4 years ago

lleeoo commented 4 years ago

On MacOS 10.14.6, VS 1.46.1, JQ Playground 3.2.2

-r works fine:

jq -r .
{"name":"JSON", "good":true}

produces

{
  "name": "JSON",
  "good": true
}

-c causes an error

jq -c .
{"name":"JSON", "good":true}

It seems to interpret the entire line as an option (notice the .).

/usr/local/bin/jq: Unknown option -c .

possible fix

Also looking at this file we see that -c is not on the list. And indeed, using --compact-output, which is on the list, works:

jq --compact-output .
{"name":"JSON", "good":true}

produces

{"name":"JSON","good":true}

BTW ctrl+enter and shift+enter don't work either.

davidnussio commented 4 years ago

Thanks for the report the issue I released the patch.

Are you reporting problems with keyboard shortcuts on mac?

davidnussio commented 4 years ago

Ok, maybe you are using jq as languageId. Try change to jqpg (jq PlayGround). I decided to enabled this shortcuts only in this context to avoid conflicts with plain jq files.

lleeoo commented 4 years ago

Thanks for the fix on -c.

re the shortcuts: I can confirm that if I change to "jqpg" then Apple+Enter works for the "Output", but Shift+Enter still does not work.

On Wed, Jul 1, 2020 at 1:49 AM David Nussio notifications@github.com wrote:

Ok, maybe you are using jq as languageId. Try change to jqpg (jq PlayGround). I decided to enabled this shortcuts only in this context to avoid conflicts with plain jq files.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/davidnussio/vscode-jq-playground/issues/52#issuecomment-651881573, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGNOMVNM6NUC7LYBBQ3AQTRZICRXANCNFSM4OL5UISQ .