Skip to content
Merged
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
2 changes: 1 addition & 1 deletion extension.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ name = "Biome Language Server"

[grammars.gritql]
repository = "https://github.com/honeycombio/tree-sitter-gritql"
rev = "9ffe44d15359476af27f07130807a5ac979e477f"
rev = "3a48815250680e85a44b3ab2fd74031ef3c66b7d"
19 changes: 19 additions & 0 deletions languages/grit/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
; By default, highlight all snippetContent nodes as JavaScript
((snippetContent) @injection.content
(#set! injection.language "javascript"))


; The rule below only matches the top-level code snippet before "where"
; Currently, tree-sitter doesn't have a way to bind the target language
; to all snippetContent nodes
; Upstream changes to both tree-sitter and tree-sitter-gritql
; are needed in order to fully support all CSS code snippets

; Highlight snippetContent as CSS if it's specified
(source_file
language: (langdecl
name: (languageName) @injection.language)
pattern: (patternWhere
pattern: (codeSnippet
source: (backtickSnippet
content: (snippetContent) @injection.content))))