Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,9 @@
[submodule "vendor/grammars/groovy.tmbundle"]
path = vendor/grammars/groovy.tmbundle
url = https://github.com/textmate/groovy.tmbundle
[submodule "vendor/grammars/groq-syntax"]
path = vendor/grammars/groq-syntax
url = https://github.com/sanity-io/groq-syntax.git
[submodule "vendor/grammars/haxe-TmLanguage"]
path = vendor/grammars/haxe-TmLanguage
url = https://github.com/vshaxe/haxe-TmLanguage
Expand Down
4 changes: 4 additions & 0 deletions grammars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,10 @@ vendor/grammars/graphviz.tmbundle:
- source.dot
vendor/grammars/groovy.tmbundle:
- source.groovy
vendor/grammars/groq-syntax:
- groq-injection.js
- groq-injection.markdown
- source.groq
vendor/grammars/haxe-TmLanguage:
- documentation.markdown.injection.haxe
- markdown.haxe.codeblock
Expand Down
8 changes: 8 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2467,6 +2467,14 @@ GN:
codemirror_mode: python
codemirror_mime_type: text/x-python
language_id: 302957008
GROQ:
type: data
color: "#fa84ff"
extensions:
- ".groq"
tm_scope: source.groq
ace_mode: text
language_id: 727704671
GSC:
type: programming
color: "#FF6800"
Expand Down
25 changes: 25 additions & 0 deletions samples/GROQ/blog-posts.groq
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Fetch published blog posts with resolved author references
*[_type == "post" && !(_id in path("drafts.**"))] | order(publishedAt desc) [0...10] {
_id,
title,
"slug": slug.current,
publishedAt,
"excerpt": pt::text(body[0..2]),
mainImage {
asset-> {
url,
"dimensions": metadata.dimensions
},
alt
},
author-> {
name,
image {
asset-> { url }
}
},
categories[]-> {
title,
"slug": slug.current
}
}
26 changes: 26 additions & 0 deletions samples/GROQ/product-filter.groq
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Product listing with faceted filtering and pagination
*[
_type == "product"
&& category->slug.current == $category
&& price >= $minPrice
&& price <= $maxPrice
&& ($brand == null || brand == $brand)
&& count(variants[inStock == true]) > 0
] | order(
select(
$sort == "price-asc" => price asc,
$sort == "price-desc" => price desc,
$sort == "newest" => _createdAt desc,
_createdAt desc
)
) [$offset...$offset + $limit] {
_id,
title,
"slug": slug.current,
price,
"compareAtPrice": math::max(variants[].compareAtPrice),
"thumbnail": images[0].asset->url,
"inStockCount": count(variants[inStock == true]),
brand,
category-> { title, "slug": slug.current }
}
29 changes: 29 additions & 0 deletions samples/GROQ/site-navigation.groq
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Resolve site-wide navigation with conditional projections
*[_type == "siteConfig"][0] {
title,
description,
"logoUrl": logo.asset->url,
mainNavigation[] {
_type == "navLink" => {
"type": "link",
title,
url
},
_type == "navGroup" => {
"type": "group",
title,
children[] {
title,
url,
"icon": icon.asset->url
}
}
},
footer {
copyright,
socialLinks[] {
platform,
url
}
}
}
1 change: 1 addition & 0 deletions vendor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ This is a list of grammars that Linguist selects to provide syntax highlighting
- **GLSL:** [euler0/sublime-glsl](https://github.com/euler0/sublime-glsl)
- **GN:** [devoncarew/language-gn](https://github.com/devoncarew/language-gn)
- **GSC:** [Jake-NotTheMuss/CoDT7-Sublime](https://github.com/Jake-NotTheMuss/CoDT7-Sublime)
- **GROQ:** [sanity-io/groq-syntax](https://github.com/sanity-io/groq-syntax)
- **Game Maker Language:** [mikomikotaishi/c.tmbundle](https://github.com/mikomikotaishi/c.tmbundle)
- **Gemfile.lock:** [hmarr/gemfile-lock-tmlanguage](https://github.com/hmarr/gemfile-lock-tmlanguage)
- **Gemini:** [printfn/gemini-vscode](https://github.com/printfn/gemini-vscode)
Expand Down
1 change: 1 addition & 0 deletions vendor/grammars/groq-syntax
Submodule groq-syntax added at a0d15c
33 changes: 33 additions & 0 deletions vendor/licenses/git_submodule/groq-syntax.dep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: groq-syntax
version: a0d15cf651c04963f8dafe836eda37cca97f5723
type: git_submodule
homepage: https://github.com/sanity-io/groq-syntax.git
license: mit
licenses:
- sources: LICENSE
text: |
MIT License

Copyright (c) 2026 Sanity.io

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
- sources: README.md
text: MIT - see [LICENSE](LICENSE).
notices: []