Files
clide/app/assets/queries/just.scm
T
jpmschweitzerandClaude ce8529e424 add tree-sitter syntax highlighting via dart:ffi
Vendor libtree-sitter.so (v0.26.8, wasmtime 44.0 statically linked)
and call its C API through dart:ffi. Grammar WASM files are loaded by
tree-sitter's embedded wasmtime engine via ts_wasm_store_load_language.

48 grammars compiled with tree-sitter build --wasm, 48 highlight
queries (42 from upstream repos, 6 written in-house for comment,
erlang, gdscript, gitignore, hcl, hlsl, swift). SQLite grammar
replaces full SQL (974K-line parser exhausted RAM at compile time).

Removes wasm_run and wasm_run_flutter — they downloaded a 22 MB
binary from GitHub at first launch, violating the no-network-on-
default-launch-path policy.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-22 22:08:00 +02:00

159 lines
2.1 KiB
Scheme

; File autogenerated by build-flavored-queries.py; do not edit
; This file specifies how matched syntax patterns should be highlighted
[
"export"
"import"
] @keyword.import
"mod" @module
[
"alias"
"set"
"shell"
] @keyword
[
"if"
"else"
] @keyword.conditional
; Variables
(value
(identifier) @variable)
(alias
left: (identifier) @variable)
(assignment
left: (identifier) @variable)
; Functions
(recipe_header
name: (identifier) @function)
(dependency
name: (identifier) @function.call)
(dependency_expression
name: (identifier) @function.call)
(function_call
name: (identifier) @function.call)
; Parameters
(parameter
name: (identifier) @variable.parameter)
; Namespaces
(module
name: (identifier) @module)
; Operators
[
":="
"?"
"=="
"!="
"=~"
"@"
"="
"$"
"*"
"+"
"&&"
"@-"
"-@"
"-"
"/"
":"
] @operator
; Punctuation
"," @punctuation.delimiter
[
"{"
"}"
"["
"]"
"("
")"
"{{"
"}}"
] @punctuation.bracket
[ "`" "```" ] @punctuation.special
; Literals
(boolean) @boolean
[
(string)
(external_command)
] @string
(escape_sequence) @string.escape
; Comments
(comment) @spell @comment
(shebang) @keyword.directive
; highlight known settings (filtering does not always work)
(setting
left: (identifier) @keyword
(#any-of? @keyword
"allow-duplicate-recipes"
"allow-duplicate-variables"
"dotenv-filename"
"dotenv-load"
"dotenv-path"
"dotenv-required"
"export"
"fallback"
"ignore-comments"
"positional-arguments"
"shell"
"shell-interpreter"
"tempdir"
"windows-powershell"
"windows-shell"
"working-directory"))
; highlight known attributes (filtering does not always work)
(attribute
(identifier) @attribute
(#any-of? @attribute
"confirm"
"doc"
"extension"
"group"
"linux"
"macos"
"metadata"
"no-cd"
"no-exit-message"
"no-quiet"
"openbsd"
"parallel"
"positional-arguments"
"private"
"script"
"unix"
"windows"
"working-directory"))
; Numbers are part of the syntax tree, even if disallowed
(numeric_error) @error