Giter Club home page Giter Club logo

Comments (4)

wader avatar wader commented on August 11, 2024 2

🥳 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

from qq.

wader avatar wader commented on August 11, 2024 1

Hey, i can list some fancy things https://github.com/wader/fq supports that might be interesting idea:

  • Auto completion of index, function, bindings and keywords. It's also done via eval so you can "complete" a query, ex {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.
  • Supports sub-REPL:s via ... | repl
  • inputs in the REPL "behaves" the same as the CLI, ex:
    $ 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
    $
  • Has a paste function
    null> paste | repl
    abc
    <ctrl-d>
    > string> .
    "abc\n"
  • Has a 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:

  • Multi-line edit of query
  • Syntax highlight and checking
  • Online documentation (at completion?)

from qq.

JFryy avatar JFryy commented on August 11, 2024

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 👍

from qq.

JFryy avatar JFryy commented on August 11, 2024

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 :)

from qq.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.