Closed pjeby closed 7 years ago
Linguist doesn't now what jq is yet, which is why it's classifying all those files as jsoniq. The first step to have jq code snippets highlighted would be to add it to Linguist.
Ah. Thanks for pointing me in the right direction. So I take it I should close this issue and open a PR with the grammar and some heuristic(s) for distinguishing the two?
Yes :-) We'll help if there's any issue with the pull request.
Great. Thanks.
@pjeby Hi, I might look into adding support. Did you make any progress?
No. I did find this JQ grammar though, that might help as a starting point.
There is also an atom grammar, which should also be helpful.
@pjeby Ok! thanks for the references!
Hi, did a first attempt here #5233
Hi there. I'm working on a project, jqmd, which makes use of
jq
blocks in markdown, meaning specifically the popular jq language for manipulating JSON data.Unfortunately, linguist apparently interprets the
jq
code tag as meaning thejsoniq
language, so I'm not sure what to do about it. I'd been planning to implement a jq grammar for Atom at some point anyway, but now I'm wondering whether that'll help on github ifjq
is going to be interpreted asjsoniq
.Doing a repository search for the JSONiq language, however, shows that many, if not most "jsoniq" code on github is in fact
jq
code, i.e. written in the stedolan/jq language, and unrelated to the jsoniq language. Even after you filter false positives for jquery, there are considerably more jq-related repositories to be found than jsoniq-related repositories.jq and jsoniq do have some minor overlap in grammar, which is probably why you haven't had many (or perhaps any) reports of this issue before. In a sufficiently simple
jq
program (e.g. one containing only expressions), the issues would not be obvious at first glance. The big differences are that jsoniq has a lot more keywords, but doesn't grokdef
,elif
,end
, or#
-comments. But for more sophisticated jq programs -- especially commented ones -- the differences are distracting and apparent.Anyway, I guess my question is, should I take a crack at implementing a jq grammar, or is the "jq" language tag "taken" as far as github is concerned? Thanks.