200ok-ch / counsel-jq Goto Github PK
View Code? Open in Web Editor NEWTraverse complex JSON and YAML structures with live feedback
Home Page: https://200ok.ch/project/counsel_jq.html
License: GNU General Public License v3.0
Traverse complex JSON and YAML structures with live feedback
Home Page: https://200ok.ch/project/counsel_jq.html
License: GNU General Public License v3.0
windows 10, emacs 26.3
just installed jq (from chocolatey) and counsel-jq
When in json buffer, M-x counsel-jq, immediately get following:
Error in post-command-hook (icomplete-post-command-hook): (wrong-number-of-arguments (1 . 1) 3)
Quit
Then get prompt for jq query.
When I use jq over the cli, querying for keys like this works fine:
code-dev/api » jq 'keys' test.json
[
"has_more",
"items",
"quota_max",
"quota_remaining"
]
When I try to do the same thing with counsel-jq (query for 'keys') on the same file, I get the following error:
jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?)
Environment is doom emacs, anyone encounter the same issue yet?
Hi,
I've found that counsel-jq
when invoked doesn't always use the buffer it was invoked from when evaluating it's queries. I've noticed in a number of cases it instead using a different buffer from the one it was invoked from.
The specific use case that fails for me in doom-emacs
is to open a new empty buffer (evil-buffer-new
), paste in a json block, then execute counsel-jq
. In this scenario counsel-jq
will never use the newly created buffer, but instead whichever buffer was selected prior.
I'm not positive, but I believe this is likely the result of using workspace features (such as persp-mode
) to curate and separate buffers into specific workspaces. In the case of more transient buffers, it seems that the buffer-list
and other-buffer
aren't always reliable to always get the last selected buffer.
I tried to install via MELPA. I didn't previously have counsel installed, and it failed to install it. It seems to depend on the ivy package, but on the swiper file which is (presumably) in the swiper package which was not installed automatically.
On the other hand, the swiper package depends on ivy, so it seems that this should depend on swiper instead. And perhaps the counsel package as well (or maybe the name is wrong)?
Compiling file /Users/iandrus/.emacs.d/elpa/counsel-jq-20191202.846/counsel-jq.el at Mon Dec 2 14:09:55 2019
Entering directory ‘/Users/iandrus/.emacs.d/elpa/counsel-jq-20191202.846/’
counsel-jq.el:12:1:Error: Cannot open load file: No such file or directory, swiper
ivy-occur
can be used to get the filtered results in a separate buffer.
It is similar to the default action which opens up the result in *jq-json*
buffer but instead uses an occur buffer.
This can help in filtering multiple json objects and compare the filtered results without having subsequent runs replace the results of previous ones.
Running ivy-occur
(C-c C-o
by default I think) opens up the full json object instead of only displaying the filtered results.
I'm unsure of what might be causing this or if this is a bug upstream in ivy.
Hi counsel-jq developers,
thanks very much for an amazing tool! I used to use jq-interactively [1] for this kind of work, but your mode appears to be much faster! I have one question though: is there a way to default the *jq-json*
results buffer to JSON?
Many thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.