1
0
mirror of https://github.com/helix-editor/helix synced 2026-01-26 05:38:09 +01:00
helix/runtime/queries
Michael Davis 86f10ae24c
Add a language to fix Rust highlights in format-args macros
This is a bit hacky. Injections cannot stack on each other like
highlights because layers can have their own injections. So this new
language `rust-format-args-macro` emulates that. It unconditionally
injects `rust-format-args` into all strings. Rust injects this new
language into known format-args macros like `println!`.

The downside is that this can cause false-positive highlights within
these macros for strings which happen to contain format-args syntax

    println!("Hello, {}!", "{}");
    //               ^ format args syntax
    //                      ^ not format args syntax, but highlighted
    //                        as if it were :(

This false-positive case is expected to be rare.

Injecting this fake language fixes regular non-string highlights in
macro invocations: macro invocations need to inject the entire token
tree and use `injection.include-children` for proper highlighting.
2025-07-13 12:01:18 -04:00
..
_gjs queries: Remove unknown predicates 2025-02-22 14:26:41 -05:00
_javascript queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
_jsx Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
_typescript queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
ada queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
adl Fix typos (#12690) 2025-02-02 18:58:29 -06:00
agda Add support for Agda (#8285) 2023-12-16 05:29:26 +01:00
alloy syntax: add grammar and highlighting for the alloy config lang (#13660) 2025-06-06 10:02:30 -05:00
amber Add support for Amber-lang (#12021) 2024-11-21 10:09:42 -06:00
astro Highlight HTML entities (#13753) 2025-06-16 08:03:02 -05:00
awk Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
bash Update Bash highlights (#13477) 2025-05-08 08:22:14 -05:00
bass Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
beancount
bibtex queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
bicep Use latest tree-sitter-bicep, support bicepparams (#11525) 2024-11-20 16:38:15 -06:00
bitbake Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
blade Update highlights.scm and injections.scm for blade.php files (#11138) 2024-07-15 22:29:14 +09:00
blueprint
c queries: Add locals.scm for C. Improve C parameter highlights (#13876) 2025-07-02 17:41:28 -05:00
c-sharp Update c-sharp queries (#12948) 2025-02-26 17:40:16 -06:00
caddyfile languages: add Caddyfile support (#13859) 2025-06-30 09:45:22 -05:00
cairo queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
capnp queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
cel Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
circom queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
clarity feat: Add Clarity language support (#13647) 2025-05-31 09:11:16 -05:00
clojure Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
cmake
codeql language support: CodeQL (#12470) 2025-01-10 09:03:04 -06:00
comment Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
common-lisp
cpon queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
cpp Fix: update c++ highlights (#13772) 2025-06-16 08:04:22 -05:00
crystal Update Crystal tree sitter and add support for ameba-ls (#13805) 2025-06-21 12:02:16 -05:00
css queries: Fix highlighting of '#' in CSS color hex codes 2025-06-16 13:43:41 -04:00
csv Add CSV language and syntax highlighting (#11973) 2025-02-10 10:51:06 -06:00
cue Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
cylc queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
d Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
dart queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
dbml DBML Language support (#8860) 2023-11-22 18:27:25 +01:00
debian Debian control file syntax highlighting (#13245) 2025-04-06 12:05:43 -05:00
devicetree Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
dhall
diff
djot Add Djot support (#12562) 2025-02-10 15:36:01 -06:00
docker-compose Add/improve textobject queries (#11513) 2024-08-17 19:27:50 +02:00
dockerfile queries/dockerfile: injections for heredocs (#13852) 2025-06-28 17:59:32 -04:00
dot queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
dtd
dune Add support for dune project language (#11829) 2024-10-06 21:53:12 +02:00
dunstrc feat: add a tree-sitter grammar and highlights for dunst's config (#13458) 2025-05-05 09:08:33 -05:00
earthfile update earthfile grammar and highlight queries (#10489) 2024-04-17 20:15:16 +09:00
ecma Highlight Ecma escape sequences (#13762) 2025-06-13 09:15:40 -05:00
edoc Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
eex
ejs
elisp Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
elixir Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
elm queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
elvish Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
env Add/improve textobject queries (#11513) 2024-08-17 19:27:50 +02:00
erb
erlang queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
esdl Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
fennel queries: Fix precedence of Fennel highlights 2025-07-01 09:40:40 -04:00
fga add support for the FGA language (#12763) 2025-02-04 11:06:22 -06:00
fidl add fidl support (#9713) 2024-02-27 01:41:50 +01:00
fish queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
forth
fortran Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
fsharp queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
gas
gdscript Updated Godot support (#11235) 2024-07-31 05:52:47 +09:00
gemini
gherkin Add gherkin syntax highlighting (#11083) 2024-08-10 08:25:31 +09:00
ghostty Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
git-attributes
git-commit Change tree-sitter parser for Git commit message files 2025-06-27 10:55:00 -04:00
git-config queries: Reverse precedence for git-config highlights 2025-02-24 10:41:09 -05:00
git-ignore
git-notes Add highlighting for git notes editmsg (#13885) 2025-07-05 10:23:53 -04:00
git-rebase
gjs Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
gleam fix: highlight floor in |> float.floor as function in Gleam (#13813) 2025-06-21 14:50:52 -04:00
glimmer Fix typos (#12690) 2025-02-02 18:58:29 -06:00
glsl
gn queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
go fix: Highlight 'x' as a character in Go 2025-06-30 10:29:20 -04:00
godot-resource queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
gomod queries/gomod: add "tool", "toolchain" to keywords (#13913) 2025-07-08 08:19:11 -05:00
gotmpl queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
gowork
gpr Improve language support for Ada (#12131) 2024-11-26 12:43:34 -06:00
graphql Add textobject for entries/elements of list-like things (#8150) 2024-03-31 11:53:15 -05:00
gren queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
groovy queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
gts Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
hare queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
haskell Update tree-sitter-haskell (#13475) 2025-05-17 07:42:52 -05:00
haskell-persistent queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
hcl queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
heex
helm feat: add suport for helm charts (#9900) 2024-03-19 15:07:44 +01:00
hocon Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
hoon Add Hoon (#9190) 2024-02-12 16:36:14 +01:00
hosts
html Highlight HTML entities (#13753) 2025-06-16 08:03:02 -05:00
htmldjango Add Django language support (#13935) 2025-07-11 10:33:44 -04:00
hurl add textobjects queries for hurl (#10594) 2024-04-29 18:17:46 +02:00
hyprlang Add support for hyprland config (#9899) 2024-03-17 23:53:30 +01:00
iex
ini Add systemd-lsp and dts-lsp (#13907) 2025-07-07 15:55:19 -05:00
ink feat: Add support for the Ink programming language (#12773) 2025-02-12 09:46:50 -06:00
inko queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
janet Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
java Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
javascript Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
jinja
jjdescription chore(jjdescription): bump rev to latest (#13329) 2025-04-11 09:06:20 -05:00
jq queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
jsdoc
json Fix precedence of JSON highlight queries for keys 2025-03-12 17:28:11 -04:00
json5 Fix precedence of JSON highlight queries for keys 2025-03-12 17:28:11 -04:00
json-ld languages: create dedicated language for json-ld (#13925) 2025-07-10 08:49:33 -05:00
jsonc Add Support for JSONC (#9906) 2024-03-17 23:54:05 +01:00
jsonnet Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
jsx Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
julia queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
just queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
kdl
koka queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
kotlin queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
koto queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
latex queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
ld Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
ldif Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
lean queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
ledger
llvm queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
llvm-mir queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
llvm-mir-yaml
log add log tree-sitter (#8916) 2023-11-29 02:42:59 +01:00
lpf
lua Add highlighting for lua methods (#13401) 2025-04-27 08:41:16 -05:00
luau feat: add luau grammars and lsp (#13702) 2025-06-08 15:21:08 -04:00
mail feat: language support for mail files (#12945) 2025-02-26 17:33:36 -06:00
make bash, make, css: highlight and indent queries improvement (#9393) 2024-01-22 19:51:12 +01:00
markdoc
markdown Improve markdown heading highlights (#12417) 2025-01-05 16:35:09 -06:00
markdown-rustdoc queries: Inject markdown into Rust doc comments 2025-05-13 19:01:10 -04:00
markdown.inline
matlab queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
mermaid
meson Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
mojo queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
move Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
msbuild
nasm Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
nestedtext Adding NestedText language support (#11987) 2024-11-20 16:39:34 -06:00
nginx feat: Nginx support (#12309) 2024-12-24 13:22:29 -06:00
nickel Bump tree-sitter-nickel (#11771) 2024-09-29 14:30:50 +02:00
nim Fix typos (#12690) 2025-02-02 18:58:29 -06:00
nix queries: inject nix into lib.literalExression string contents (#13851) 2025-06-28 18:00:58 -04:00
nu Update grammars for Nushell to rev 358c4f50 (#9502) 2024-02-04 02:04:51 +01:00
nunjucks
ocaml queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
ocaml-interface
odin queries: Odin or_break+or_continue keywords, struct indents 2025-07-08 19:05:48 -04:00
ohm feat: Add Ohm language support (#9991) 2024-03-24 23:30:59 +01:00
opencl Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
openscad chore: Point OpenSCAD grammar to official repo (#13033) 2025-03-12 16:10:38 -05:00
org
pascal Fix typos (#12690) 2025-02-02 18:58:29 -06:00
passwd
pem
perl Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
pest Add pest support (#10616) 2024-04-29 17:44:03 +02:00
php Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
php-only Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
pkgbuild Enhance support for PKGBUILDS (#9909) 2024-03-19 13:27:46 +01:00
pkl Fix typos (#12690) 2025-02-02 18:58:29 -06:00
po queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
pod Update some grammars to a commit where the license file is included (#9279) 2024-01-25 14:12:17 +09:00
ponylang queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
powershell Add PowerShell highlighting (#9827) 2024-03-07 23:39:00 +01:00
prisma Add/improve textobject queries (#11513) 2024-08-17 19:27:50 +02:00
prolog Add Prolog tree-sitter grammar (#11611) 2025-04-06 11:43:53 -05:00
properties languages: add Java .properties file support (#13874) 2025-07-04 09:17:22 -05:00
protobuf Migrate to an improved proto grammar (#12225) 2024-12-31 13:41:53 -06:00
prql
pug Add support for Pug language (#13435) 2025-05-05 08:57:00 -05:00
purescript chore: bump purescript grammar (#13782) 2025-06-18 09:11:28 -05:00
python chore: updated c,c++ highlights (#13747) 2025-06-12 09:28:09 -05:00
qml queries: add textobjects for qml (#13855) 2025-07-03 22:19:22 -04:00
quarto feat: add basic Quarto support (#13339) 2025-04-16 08:03:21 -05:00
quint Basic injection queries for Quint (#13322) 2025-04-11 10:31:57 -05:00
r queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
racket
regex queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
rego
rescript queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
rmarkdown
robot
ron Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
rst
ruby queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
rust Add a language to fix Rust highlights in format-args macros 2025-07-13 12:01:18 -04:00
rust-format-args feat: highlight rust string interpolation macros that use format_args! (#13533) 2025-05-24 10:02:32 -05:00
rust-format-args-macro Add a language to fix Rust highlights in format-args macros 2025-07-13 12:01:18 -04:00
sage
scala queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
scheme queries(scheme): consider the first argument of λ to be a variable (#13143) 2025-03-20 08:54:26 -05:00
scss Update scss and highlights (#13414) 2025-04-26 11:35:31 -04:00
slang feat: add basic Slang support (#13449) 2025-05-05 09:03:40 -05:00
slint Fix typos (#12690) 2025-02-02 18:58:29 -06:00
smali queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
smithy
sml
snakemake Adding snakemake to language (#11858) 2024-10-18 23:12:36 +02:00
solidity queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
sourcepawn feat: Add SourcePawn language support (#13028) 2025-03-07 11:55:48 -06:00
spade Bump Spade grammar (#12583) 2025-01-18 09:43:45 -06:00
spicedb languages: add CEL, SpiceDB schema language (#9296) 2024-02-12 02:28:52 +01:00
sql feat(sql): update tree-sitter files (#12837) 2025-02-13 07:16:27 -06:00
sshclientconfig
starlark feat: add indents for starlark (#13126) 2025-03-18 09:18:45 -05:00
strace Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
supercollider Add initial support for SuperCollider (#9329) 2024-03-18 13:13:23 +01:00
svelte Fix: Svelte queries (#10487) 2024-04-16 23:56:43 +02:00
sway queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
swift queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
systemd Add systemd-lsp and dts-lsp (#13907) 2025-07-07 15:55:19 -05:00
t32 Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
tablegen queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
tact queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
task
tcl Add tcl highlighting (#9837) 2024-04-04 03:31:00 +02:00
teal queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
templ languages: update templ (#10114) 2024-04-03 10:31:44 +09:00
tera queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
textproto Add support for textproto language. (#11874) 2024-11-20 15:57:30 -06:00
tfvars
thrift queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
tlaplus queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
todotxt
toml feat: added comment textobject to toml (#12952) 2025-02-26 17:40:34 -06:00
tsq Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
tsx Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
twig Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
typescript Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
typespec Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
typst Add comment injection to typst queries (#10628) 2024-04-29 17:44:20 +02:00
ungrammar fix(highlights/ungrammar): improve UX (#13607) 2025-05-25 08:47:10 -05:00
unison queries: Fix module/namespace highlight in Unison 2025-02-02 18:39:07 -05:00
uxntal queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
v Update tree-sitter-v (#13469) 2025-05-07 17:38:07 -05:00
vala Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
vento Add support for the Vento template language (#12147) 2024-12-02 09:03:11 -06:00
verilog queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
vhdl update vhdl tree-sitter (#13091) 2025-03-12 09:47:37 -05:00
vhs Reverse highlight precedence ordering (#9458) 2025-02-02 18:17:10 -06:00
vue add support for tree-sitter custom template languages on vue (#13511) 2025-05-12 08:23:59 -05:00
wast
wat
webc
werk add werk language and highlights (#13136) 2025-03-20 08:04:52 -05:00
wesl queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
wgsl feat: add wgsl built-in functions to @function.builtin (#13479) 2025-05-08 07:56:36 -05:00
wit
wren queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
xit
xml
xtc Add support for Xena OpenAutomation files (#10448) 2024-04-16 15:33:50 +02:00
yaml queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
yara queries: Rewrite all locals 2025-05-13 19:01:10 -04:00
yuck queries: Remove (ERROR) from all highlights 2025-02-04 09:35:38 -05:00
zig reverse zig highlights (#12777) 2025-02-04 20:38:15 -06:00