-
I have this original JSON:

-
When I type .results[], jnv correctly filters the results:

-
Then, if I additionally type some string, it seems jnv tries to evaluate the entire input text as a jq expression, completely reverting the filtering. This is extremely annoying because the input text being typed is of course generally an incomplete jq expression:

-
When I complete typing the expression, jnv again succeeds to evaluate the expression:

Question
Is it possible to disrespect (i.e. ignore) an incomplete jq expression being typed and instead fall back to the longest valid prefix?
For example:
| input text |
longest valid prefix |
.results[] |
.results[] |
.results[] | |
.results[] |
.results[] | select |
.results[] |
.results[] | select(.type == |
.results[] |
.results[] | select(.type == "type1" |
.results[] |
.results[] | select(.type == "type1") |
.results[] | select(.type == "type1") |
Original JSON
{
"results": [
{
"type": "type1",
"value": "value1"
},
{
"type": "type1",
"value": "value2"
},
{
"type": "type2",
"value": "value3"
}
]
}
I have this original JSON:
When I type
.results[],jnvcorrectly filters the results:Then, if I additionally type some string, it seems
jnvtries to evaluate the entire input text as a jq expression, completely reverting the filtering. This is extremely annoying because the input text being typed is of course generally an incomplete jq expression:When I complete typing the expression,
jnvagain succeeds to evaluate the expression:Question
Is it possible to disrespect (i.e. ignore) an incomplete jq expression being typed and instead fall back to the longest valid prefix?
For example:
.results[].results[].results[] |.results[].results[] | select.results[].results[] | select(.type ==.results[].results[] | select(.type == "type1".results[].results[] | select(.type == "type1").results[] | select(.type == "type1")Original JSON
{ "results": [ { "type": "type1", "value": "value1" }, { "type": "type1", "value": "value2" }, { "type": "type2", "value": "value3" } ] }