Open JFryy opened 3 days ago
Hey, i can list some fancy things https://github.com/wader/fq supports that might be interesting idea:
{abc:123} | .a<tab>
works, might seem supercomplex but it's a bit of a trick: it only works if the query to the left of the cursor is valid query (with some extra heuristics for indexing). Also bindings don't work well as they are generally in some scope, mostly useful for globals.... | repl
$ fq -i '1,2'
number, ...[0:3][]> .*2
2
4
number, ...[0:2][]> .*2 | repl
> number, ...[0:2][]> .*2
4
8
> number, ...[0:2][]> ^D
number, ...[0:2][]> ^D
$
paste
function
null> paste | repl
abc
<ctrl-d>
> string> .
"abc\n"
slurp
/spew
function but i have to say i have nearly never used them, maybe if one could come up with some neater syntax that works well with jq.
null> 1,2,3 | slurp("hello")
null> $hello
[
1,
2,
3
]
null> spew("hello")
1
2
3
Things i would like to have:
Thanks a lot for the advice and detailing some of the functionality/many features of fq
(big fan btw!), these suggestions would definitely be a major improvement and I look forward to taking a crack at some of them 👍
🥳 Think my advice would be to first focus on really nice and fancy completion, that is what i use all the time with fq. sub-repl i use a tiny bit, slurp/spew not at all. "realtime" syntax checking and highlighting would be really nice but i haven't look into it, for fq it would probably also involve quite a lot of work on the readline implementation that i use.
btw if you write lots of jq i can recommend https://github.com/wader/jq-lsp
Sorry, I definitely used the word "realtime" a bit too liberally in the readme. Very cool, will take a look and see if I can't hack something together w/ any of this when I have time if no one decides they want to work on abeforehand. If anyone wants to work on any component of the above mentioned, I am not too opinionated on implementation as long as it's approximates some of the above improvements @wader mentioned or the post @ here.#6 or any user interface improvements :)
qq needs to refine its a tui. To keep this short, a few things could be implemented to get a lot more value from a tui on a general transcoder/interface. This is not my strong suit for guidance of this tool, so I could very much use some help. If there is a developer who'd like to contribute, here are a few ideas I've been wanting to implement, some of which I can and want to do, some of which I might not be the greatest at, e.g. anything regarding TUI placement/Aesthetics.
-G
--grep
flag but is is honestly debatable whether a regex engine should be generally included, maybe grepping should be strictly modular)