1

Update generated neovim config

This commit is contained in:
2024-09-22 20:41:25 +02:00
parent 1743764e48
commit aa1271c42c
1247 changed files with 26512 additions and 15067 deletions

View File

@ -1,7 +0,0 @@
/lua/nvim-treesitter/textobjects/ @theHamsta
/lua/nvim-treesitter/incremental_selection.lua @theHamsta
/lua/nvim-treesitter/fold.lua @vigoux
/lua/nvim-treesitter/highlight.lua @vigoux
/lua/nvim-treesitter/refactor/ @steelsojka

View File

@ -27,7 +27,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Lint with stylua
uses: JohnnyMorganz/stylua-action@v3
uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: latest

View File

@ -287,7 +287,7 @@ A conceal can be restricted to part of the capture via the [`#offset!` directive
#### Priority
Captures can be assigned a priority to control precedence of highlights via the
`#set! "priority" <number>` directive (see `:h treesitter-highlight-priority`).
`#set! priority <number>` directive (see `:h treesitter-highlight-priority`).
The default priority for treesitter highlights is `100`; queries should only
set priorities between `90` and `120`, to avoid conflict with other sources of
highlighting (such as diagnostics or LSP semantic tokens).
@ -336,7 +336,7 @@ doSomething(); // Should point to the declaration as the definition
```query
(function_declaration
((identifier) @local.definition.var)
(#set! "definition.var.scope" "parent"))
(#set! definition.var.scope "parent"))
```
Possible scope values are:

View File

@ -176,7 +176,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [ada](https://github.com/briot/tree-sitter-ada) (maintained by @briot)
- [x] [agda](https://github.com/tree-sitter/tree-sitter-agda) (maintained by @Decodetalkers)
- [x] [angular](https://github.com/dlvandenberg/tree-sitter-angular) (experimental, maintained by @dlvandenberg)
- [x] [apex](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber)
- [x] [apex](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland)
- [x] [arduino](https://github.com/ObserverOfTime/tree-sitter-arduino) (maintained by @ObserverOfTime)
- [x] [asm](https://github.com/RubixDev/tree-sitter-asm) (maintained by @RubixDev)
- [x] [astro](https://github.com/virchau13/tree-sitter-astro) (maintained by @virchau13)
@ -241,6 +241,8 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [fsh](https://github.com/mgramigna/tree-sitter-fsh) (maintained by @mgramigna)
- [x] [func](https://github.com/amaanq/tree-sitter-func) (maintained by @amaanq)
- [x] [fusion](https://gitlab.com/jirgn/tree-sitter-fusion.git) (maintained by @jirgn)
- [x] [GAP system](https://github.com/gap-system/tree-sitter-gap) (maintained by @reiniscirpons)
- [x] [GAP system test files](https://github.com/gap-system/tree-sitter-gaptst) (maintained by @reiniscirpons)
- [x] [Godot (gdscript)](https://github.com/PrestonKnopp/tree-sitter-gdscript) (maintained by @PrestonKnopp)
- [x] [gdshader](https://github.com/GodOfAvacyn/tree-sitter-gdshader) (maintained by @godofavacyn)
- [x] [git_config](https://github.com/the-mikedavis/tree-sitter-git-config) (maintained by @amaanq)
@ -249,7 +251,9 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [gitcommit](https://github.com/gbprod/tree-sitter-gitcommit) (maintained by @gbprod)
- [x] [gitignore](https://github.com/shunsambongi/tree-sitter-gitignore) (maintained by @theHamsta)
- [x] [gleam](https://github.com/gleam-lang/tree-sitter-gleam) (maintained by @amaanq)
- [x] [Glimmer and Ember](https://github.com/alexlafroscia/tree-sitter-glimmer) (maintained by @NullVoxPopuli)
- [x] [Glimmer and Ember](https://github.com/ember-tooling/tree-sitter-glimmer) (maintained by @NullVoxPopuli)
- [x] [glimmer_javascript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript) (maintained by @NullVoxPopuli)
- [x] [glimmer_typescript](https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript) (maintained by @NullVoxPopuli)
- [x] [glsl](https://github.com/theHamsta/tree-sitter-glsl) (maintained by @theHamsta)
- [x] [GN (Generate Ninja)](https://github.com/amaanq/tree-sitter-gn) (maintained by @amaanq)
- [x] [gnuplot](https://github.com/dpezto/tree-sitter-gnuplot) (maintained by @dpezto)
@ -343,14 +347,15 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [passwd](https://github.com/ath3/tree-sitter-passwd) (maintained by @amaanq)
- [x] [pem](https://github.com/ObserverOfTime/tree-sitter-pem) (maintained by @ObserverOfTime)
- [x] [perl](https://github.com/tree-sitter-perl/tree-sitter-perl) (maintained by @RabbiVeesh, @LeoNerd)
- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka)
- [x] [php_only](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka)
- [x] [php](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka, @calebdw)
- [x] [php_only](https://github.com/tree-sitter/tree-sitter-php) (maintained by @tk-shirasaka, @calebdw)
- [x] [phpdoc](https://github.com/claytonrcarter/tree-sitter-phpdoc) (experimental, maintained by @mikehaertl)
- [x] [pioasm](https://github.com/leo60228/tree-sitter-pioasm) (maintained by @leo60228)
- [x] [po](https://github.com/erasin/tree-sitter-po) (maintained by @amaanq)
- [x] [pod](https://github.com/tree-sitter-perl/tree-sitter-pod) (maintained by @RabbiVeesh, @LeoNerd)
- [x] [Path of Exile item filter](https://github.com/ObserverOfTime/tree-sitter-poe-filter) (experimental, maintained by @ObserverOfTime)
- [x] [pony](https://github.com/amaanq/tree-sitter-pony) (maintained by @amaanq, @mfelsche)
- [x] [powershell](https://github.com/airbus-cert/tree-sitter-powershell) (maintained by @L2jLiga)
- [x] [printf](https://github.com/ObserverOfTime/tree-sitter-printf) (maintained by @ObserverOfTime)
- [x] [prisma](https://github.com/victorhqc/tree-sitter-prisma) (maintained by @elianiva)
- [x] [problog](https://github.com/foxyseta/tree-sitter-prolog) (maintained by @foxyseta)
@ -379,6 +384,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [regex](https://github.com/tree-sitter/tree-sitter-regex) (maintained by @theHamsta)
- [x] [rego](https://github.com/FallenAngel97/tree-sitter-rego) (maintained by @FallenAngel97)
- [x] [pip requirements](https://github.com/ObserverOfTime/tree-sitter-requirements) (maintained by @ObserverOfTime)
- [x] [rescript](https://github.com/rescript-lang/tree-sitter-rescript) (maintained by @ribru17)
- [x] [rnoweb](https://github.com/bamonroe/tree-sitter-rnoweb) (maintained by @bamonroe)
- [x] [robot](https://github.com/Hubro/tree-sitter-robot) (maintained by @Hubro)
- [x] [robots](https://github.com/opa-oz/tree-sitter-robots-txt) (maintained by @opa-oz)
@ -391,14 +397,15 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [scfg](https://github.com/rockorager/tree-sitter-scfg) (maintained by @WhyNotHugo)
- [ ] [scheme](https://github.com/6cdh/tree-sitter-scheme)
- [x] [scss](https://github.com/serenadeai/tree-sitter-scss) (maintained by @elianiva)
- [x] [sflog](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland)
- [x] [slang](https://github.com/theHamsta/tree-sitter-slang) (experimental, maintained by @theHamsta)
- [x] [slint](https://github.com/slint-ui/tree-sitter-slint) (maintained by @hunger)
- [x] [smali](https://github.com/tree-sitter-grammars/tree-sitter-smali) (maintained by @amaanq)
- [x] [smithy](https://github.com/indoorvivants/tree-sitter-smithy) (maintained by @amaanq, @keynmol)
- [ ] [snakemake](https://github.com/osthomas/tree-sitter-snakemake) (experimental)
- [x] [solidity](https://github.com/JoranHonig/tree-sitter-solidity) (maintained by @amaanq)
- [x] [soql](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber)
- [x] [sosl](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber)
- [x] [soql](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland)
- [x] [sosl](https://github.com/aheber/tree-sitter-sfapex) (maintained by @aheber, @xixiaofinland)
- [x] [sourcepawn](https://github.com/nilshelmig/tree-sitter-sourcepawn) (maintained by @Sarrus1)
- [x] [sparql](https://github.com/GordianDziwis/tree-sitter-sparql) (maintained by @GordianDziwis)
- [x] [sql](https://github.com/derekstride/tree-sitter-sql) (maintained by @derekstride)
@ -449,6 +456,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [vhs](https://github.com/charmbracelet/tree-sitter-vhs) (maintained by @caarlos0)
- [x] [vim](https://github.com/neovim/tree-sitter-vim) (maintained by @clason)
- [x] [vimdoc](https://github.com/neovim/tree-sitter-vimdoc) (maintained by @clason)
- [x] [vrl](https://github.com/belltoy/tree-sitter-vrl) (maintained by @belltoy)
- [x] [vue](https://github.com/tree-sitter-grammars/tree-sitter-vue) (maintained by @WhyNotHugo, @lucario387)
- [x] [wgsl](https://github.com/szebniok/tree-sitter-wgsl) (maintained by @szebniok)
- [x] [wgsl_bevy](https://github.com/theHamsta/tree-sitter-wgsl-bevy) (maintained by @theHamsta)
@ -460,7 +468,7 @@ We are looking for maintainers to add more parsers and to write query files for
- [x] [yang](https://github.com/Hubro/tree-sitter-yang) (maintained by @Hubro)
- [x] [yuck](https://github.com/Philipp-M/tree-sitter-yuck) (maintained by @Philipp-M, @amaanq)
- [x] [zathurarc](https://github.com/Freed-Wu/tree-sitter-zathurarc) (maintained by @Freed-Wu)
- [x] [zig](https://github.com/maxxnino/tree-sitter-zig) (maintained by @maxxnino)
- [x] [zig](https://github.com/tree-sitter-grammars/tree-sitter-zig) (maintained by @amaanq)
<!--parserinfo-->
For related information on the supported languages, including related plugins, see [this wiki page](https://github.com/nvim-treesitter/nvim-treesitter/wiki/Supported-Languages-Information).

View File

@ -6,16 +6,16 @@
"revision": "d3dc807692e6bca671d4491b3bf5c67eeca8c016"
},
"angular": {
"revision": "31182d43b062a350d4bd2449f2fc0d5654972be9"
"revision": "c473dbc54ca27f95d8928cfdb2a1a79300e16951"
},
"apex": {
"revision": "c99ad4b16d112fea91745e3f1b769754239fdaba"
"revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59"
},
"arduino": {
"revision": "afb34b2c65f507932c5c6ddbf0d5a9ca6a772f2f"
"revision": "1db90b2b54c995ee8ff8e64dabeb4a5971287c16"
},
"asm": {
"revision": "b0306e9bb2ebe01c6562f1aef265cc42ccc53070"
"revision": "55b2b913f1e71136027d6fce8212e760c64f3532"
},
"astro": {
"revision": "4be180759ec13651f72bacee65fa477c64222a1a"
@ -33,7 +33,7 @@
"revision": "28dc7059722be090d04cd751aed915b2fee2f89a"
},
"beancount": {
"revision": "384c55ede2a1f13e83d8e18dbef8f11304c379c2"
"revision": "01c0da29e0fc7130420a09d939ecc524e09b6ba6"
},
"bibtex": {
"revision": "ccfd77db0ed799b6c22c214fe9d2937f47bc8b34"
@ -51,10 +51,10 @@
"revision": "4e60cf3c2e613625c06f6f85540b3631e2d06cd3"
},
"c": {
"revision": "be23d2c9d8e5b550e713ef0f86126a248462ca6e"
"revision": "927da1f210ebb24b7f109230a61a55b428875985"
},
"c_sharp": {
"revision": "31a64b28292aac6adf44071e449fa03fb80eaf4e"
"revision": "fd7f7402db6e66afd70b402fb2e367b2d71c10d6"
},
"cairo": {
"revision": "6238f609bea233040fe927858156dee5515a0745"
@ -72,7 +72,7 @@
"revision": "69d7a8b0f7493b0dbb07d54e8fea96c5421e8a71"
},
"comment": {
"revision": "5d8b29f6ef3bf64d59430dcfe76b31cc44b5abfd"
"revision": "3555706cef8b98d3e4c7379d7260548ff03ad363"
},
"commonlisp": {
"revision": "bf2a65b1c119898a1a17389e07f2a399c05cdc0c"
@ -87,28 +87,28 @@
"revision": "594289eadfec719198e560f9d7fd243c4db678d5"
},
"cpp": {
"revision": "0b4aa47f07d958a49260aadc87e8474b03897c23"
"revision": "b1a4e2b25148f3cfcb5f241cbc4c49f001a6fb35"
},
"css": {
"revision": "f6be52c3d1cdb1c5e4dd7d8bce0a57497f55d6af"
"revision": "9af0bdd9d225edee12f489cfa8284e248321959b"
},
"csv": {
"revision": "7eb7297823605392d2bbcc4c09b1cd18d6fa9529"
},
"cuda": {
"revision": "07f2f157d484a27dc91c04cc116f94f6fd4fc654"
"revision": "8812343a1f8496fc219f3d07a270f9c1d6ba3391"
},
"cue": {
"revision": "8a5f273bfa281c66354da562f2307c2d394b6c81"
},
"d": {
"revision": "750dde90ed9cdbd82493bc28478d8ab1976b0e9f"
"revision": "ac584585a15c4cacd6cda8e6bfe7cb1ca7b3898e"
},
"dart": {
"revision": "ac0bb849ccd1a923963af47573b5e396736ff582"
"revision": "9ac03bb2154316624fb4c41fe0f372a5f1597b43"
},
"devicetree": {
"revision": "fb07e6044ffd36932c57a5be01ba5d6b8a9337bb"
"revision": "296b3c294a8bcfca6673296d99f9cd37049b8026"
},
"dhall": {
"revision": "affb6ee38d629c9296749767ab832d69bb0d9ea8"
@ -141,7 +141,7 @@
"revision": "8e635b0b723c620774dfb8abf382a7f531894b40"
},
"editorconfig": {
"revision": "c5f83685a64117872ae750ce14333a7a1dddcf0b"
"revision": "faf014c607f912ff666b20183d32a03dcfc3111d"
},
"eds": {
"revision": "0ad62cb635c2f4353359a88dec9e3a57bbf9f66d"
@ -162,10 +162,10 @@
"revision": "5e7210d945425b77f82cbaebc5af4dd3e1ad40f5"
},
"embedded_template": {
"revision": "38d5004a797298dc42c85e7706c5ceac46a3f29f"
"revision": "62b0a6e45900a7dff7c37da95fec20a09968ba52"
},
"erlang": {
"revision": "19ca500fa5a17ab58dc18aa03b50e2db305e7a8a"
"revision": "0b5a0dcfcedd9b397252cb5568cc55ab1905b1a9"
},
"facility": {
"revision": "2d037f2f2bf668737f72e6be6eda4b7918b68d86"
@ -192,7 +192,7 @@
"revision": "90189238385cf636b9ee99ce548b9e5b5e569d48"
},
"fortran": {
"revision": "6b633433fb3f132f21250cf8e8be76d5a6389b7e"
"revision": "8f842945abefb76b9a68c0835619b37060b8f098"
},
"fsh": {
"revision": "fad2e175099a45efbc98f000cc196d3674cc45e0"
@ -203,6 +203,12 @@
"fusion": {
"revision": "19db2f47ba4c3a0f6238d4ae0e2abfca16e61dd6"
},
"gap": {
"revision": "141b063335e85299bde3f61b4888d02d674a1abc"
},
"gaptst": {
"revision": "e0723dc6136309b3d5904dad2c73ef71267428c1"
},
"gdscript": {
"revision": "1f1e782fe2600f50ae57b53876505b8282388d77"
},
@ -213,7 +219,7 @@
"revision": "9c2a1b7894e6d9eedfe99805b829b4ecd871375e"
},
"git_rebase": {
"revision": "274e27ea0f09371122ab55b8a812a32d6ef644e8"
"revision": "bff4b66b44b020d918d67e2828eada1974a966aa"
},
"gitattributes": {
"revision": "41940e199ba5763abea1d21b4f717014b45f01ea"
@ -225,10 +231,16 @@
"revision": "f4685bf11ac466dd278449bcfe5fd014e94aa504"
},
"gleam": {
"revision": "84fa6b0d53b6dd9414797e659923719799e3b0a8"
"revision": "0d38bfdc04cc90d7541c21e39089e35e40c429d3"
},
"glimmer": {
"revision": "6b25d265c990139353e1f7f97baf84987ebb7bf0"
"revision": "da605af8c5999b43e6839b575eae5e6cafabb06f"
},
"glimmer_javascript": {
"revision": "a260911201684f80cf815418b3771e6c39309f81"
},
"glimmer_typescript": {
"revision": "9d018a0f93417e6951264a26093b89ee63df7315"
},
"glsl": {
"revision": "ddc3137a2d775aca93084ff997fa13cc1691058a"
@ -240,22 +252,22 @@
"revision": "3c895f5d9c0b3a3c7e02383766b462c21913c000"
},
"go": {
"revision": "7ee8d928db5202f6831a78f8112fd693bf69f98b"
"revision": "6204b7308a32e991a8daed2e9895a90be55a510a"
},
"goctl": {
"revision": "f107937259c7ec4bb05f7e3d2c24b89ac36d4cc3"
"revision": "49c43532689fe1f53e8b9e009d0521cab02c432b"
},
"godot_resource": {
"revision": "2ffb90de47417018651fc3b970e5f6b67214dc9d"
},
"gomod": {
"revision": "bbe2fe3be4b87e06a613e685250f473d2267f430"
"revision": "1f55029bacd0a6a11f6eb894c4312d429dcf735c"
},
"gosum": {
"revision": "e2ac513b2240c7ff1069ae33b2df29ce90777c11"
},
"gotmpl": {
"revision": "9d3f6e526dd074b9edae9070b7bb778f00e87a5b"
"revision": "fd9e1c6647e5e9b23918d00d1e48710d0f703e19"
},
"gowork": {
"revision": "949a8a470559543857a62102c84700d291fc984c"
@ -267,7 +279,7 @@
"revision": "5e66e961eee421786bdda8495ed1db045e06b5fe"
},
"groovy": {
"revision": "f3615006429251a966d7452bd46a0171364bcb7b"
"revision": "171b3b7412bc93284fc0dad0a7a7bbbbd1b51289"
},
"gstlaunch": {
"revision": "549aef253fd38a53995cda1bf55c501174372bf7"
@ -288,19 +300,19 @@
"revision": "9e3ec9848f28d26845ba300fd73c740459b83e9b"
},
"heex": {
"revision": "b5ad6e34eea18a15bbd1466ca707a17f9bff7b93"
"revision": "6dd0303acf7138dd2b9b432a229e16539581c701"
},
"helm": {
"revision": "9d3f6e526dd074b9edae9070b7bb778f00e87a5b"
"revision": "fd9e1c6647e5e9b23918d00d1e48710d0f703e19"
},
"hjson": {
"revision": "02fa3b79b3ff9a296066da6277adfc3f26cbc9e0"
},
"hlsl": {
"revision": "80517ca13317fb8591503c0d99f2ad76e8979a72"
"revision": "5d788a46727c8199a7c63a3c849092e0364375b6"
},
"hlsplaylist": {
"revision": "64f19029339e75d6762feae39e7878595860c980"
"revision": "3bfda9271e3adb08d35f47a2102fe957009e1c55"
},
"hocon": {
"revision": "c390f10519ae69fdb03b3e5764f5592fb6924bcc"
@ -309,25 +321,25 @@
"revision": "a24c5a39d1d7e993a8bee913c8e8b6a652ca5ae8"
},
"html": {
"revision": "e4d834eb4918df01dcad5c27d1b15d56e3bd94cd"
"revision": "d11201a263d02169d303db903ba0bb13dc59e068"
},
"htmldjango": {
"revision": "ea71012d3fe14dd0b69f36be4f96bdfe9155ebae"
},
"http": {
"revision": "e061995f0caf2fa30f68fa1fdf2c08bcbd4629a8"
"revision": "49e1ceefcdcf89abfd4d8f013359cf90c615b1cd"
},
"hurl": {
"revision": "ad705af8c44c737bdb965fc081329c50716d2d03"
"revision": "fba6ed8db3a009b9e7d656511931b181a3ee5b08"
},
"hyprlang": {
"revision": "6858695eba0e63b9e0fceef081d291eb352abce8"
},
"idl": {
"revision": "e0fb8591d0acbb195d190d644140f821671f0011"
"revision": "5573b295410201ed22771776b34d636900eba368"
},
"ini": {
"revision": "87176e524f0a98f5be75fa44f4f0ff5c6eac069c"
"revision": "962568c9efa71d25720ab42c5d36e222626ef3a6"
},
"inko": {
"revision": "234c87be1dac20f766ddf6f486a7bde2a4bc5594"
@ -336,13 +348,13 @@
"revision": "9b2f9aec2106b94b4e099fe75e73ebd8ae707c04"
},
"janet_simple": {
"revision": "3b08641373cb3e37bc531e6e3cdb85d02b454702"
"revision": "12bfab7db8a5f5b1d774ef84b5831acd34936071"
},
"java": {
"revision": "953abfc8bb3eb2f578e1f461edba4a9885f974b8"
"revision": "245b05c6ba900fa708242835f6168ef76f9d951e"
},
"javascript": {
"revision": "12e45374422f6051648717be62f0ffc40a279ee2"
"revision": "463fec0831011cab830429fbe1da2796cfc1cfb4"
},
"jq": {
"revision": "13990f530e8e6709b7978503da9bc8701d366791"
@ -351,7 +363,7 @@
"revision": "49fde205b59a1d9792efc21ee0b6d50bbd35ff14"
},
"json": {
"revision": "94f5c527b2965465956c2000ed6134dd24daf2a7"
"revision": "bdd69eb8c8a58a9f54df03de0488d9990179be46"
},
"json5": {
"revision": "ab0ba8229d639ec4f3fa5f674c9133477f4b77bd"
@ -360,13 +372,13 @@
"revision": "02b01653c8a1c198ae7287d566efa86a135b30d5"
},
"jsonnet": {
"revision": "d34615fa12cc1d1cfc1f1f1a80acc9db80ee4596"
"revision": "ddd075f1939aed8147b7aa67f042eda3fce22790"
},
"julia": {
"revision": "f1baa5f8e271109d01cc8ff7473c11df2d8a9aee"
"revision": "a528de39923448e6b809a6b9f686f3472728f202"
},
"just": {
"revision": "379fbe36d1e441bc9414ea050ad0c85c9d6935ea"
"revision": "6648ac1c0cdadaec8ee8bcf9a4ca6ace5102cf21"
},
"kconfig": {
"revision": "486fea71f61ad9f3fd4072a118402e97fe88d26c"
@ -375,7 +387,7 @@
"revision": "b37e3d58e5c5cf8d739b315d6114e02d42e66664"
},
"kotlin": {
"revision": "c9cb8504b81684375e7beb8907517dbd6947a1be"
"revision": "7276b93ca6754c21f9630757e753f1b6aec500c1"
},
"koto": {
"revision": "d4109879ba1387d19095269a7473bd7d274ab848"
@ -387,19 +399,19 @@
"revision": "854a40e99f7c70258e522bdb8ab584ede6196e2e"
},
"latex": {
"revision": "12523bd1ffd2c428b2dad177e2b4555574d90973"
"revision": "90fd9894bebddce79f5b8041e7f82523364a619b"
},
"ledger": {
"revision": "8a841fb20ce683bfbb3469e6ba67f2851cfdf94a"
},
"leo": {
"revision": "304611b5eaf53aca07459a0a03803b83b6dfd3b3"
"revision": "6ca11a96fc2cab51217e0cf4a2f9ed3ea63e28fb"
},
"linkerscript": {
"revision": "f99011a3554213b654985a4b0a65b3b032ec4621"
},
"liquid": {
"revision": "7862a3424832c3a9d45eb21143b375837bd6573b"
"revision": "4c19cc5b2b408de590f83497a90cc941ed59ea06"
},
"liquidsoap": {
"revision": "14feafa91630afb1ab9988cf9b738b7ea29f3f89"
@ -420,7 +432,7 @@
"revision": "fbadc96272f718dba267628ba7b0e694c368cef3"
},
"m68k": {
"revision": "9e082a2253c50eb3d80e84bbd635e57cfb1476a2"
"revision": "e128454c2210c0e0c10b68fe45ddb8fee80182a3"
},
"make": {
"revision": "a4b9187417d6be349ee5fd4b6e77b4172c6827dd"
@ -432,7 +444,7 @@
"revision": "7fe453beacecf02c86f7736439f238f5bb8b5c9b"
},
"matlab": {
"revision": "2825fb578325ac308945318881445a89ea06e0f6"
"revision": "306c43ab28b7b8a4976e40ff0a7c26b019ad52df"
},
"menhir": {
"revision": "be8866a6bcc2b563ab0de895af69daeffa88fe70"
@ -444,10 +456,10 @@
"revision": "bd17c824196ce70800f64ad39cfddd1b17acc13f"
},
"mlir": {
"revision": "affbd6f3b08155826a22cfa8373147acbf60f1f1"
"revision": "02af5a1a1cfa69a094e3136b10dfb602f968232e"
},
"muttrc": {
"revision": "90ef60852c410bd964cd3b954366e4c403c17314"
"revision": "173b0ab53a9c07962c9777189c4c70e90f1c1837"
},
"nasm": {
"revision": "570f3d7be01fffc751237f4cfcf52d04e20532d1"
@ -456,7 +468,7 @@
"revision": "281d184b8240b2b22670b8907b57b6d6842db6f3"
},
"nickel": {
"revision": "3039ad9e9af3c1ffe049a04ee83a2b489915b0b9"
"revision": "88d836a24b3b11c8720874a1a9286b8ae838d30a"
},
"nim": {
"revision": "897e5d346f0b59ed62b517cfb0f1a845ad8f0ab7"
@ -468,10 +480,10 @@
"revision": "0a95cfdc0745b6ae82f60d3a339b37f19b7b9267"
},
"nix": {
"revision": "0fdada10f1f845ca9116e279ad8f5d0ca93e9949"
"revision": "537095ddc80cf610fa75a2a0149fe9799b011014"
},
"norg": {
"revision": "aa1a1a7ded81a094cc3d5cb14bea6f34b86d8688"
"revision": "1aab69c95bd9d5e7c0e172ecbe5d29bcf5834612"
},
"nqc": {
"revision": "14e6da1627aaef21d2b2aa0c37d04269766dcc1d"
@ -498,7 +510,7 @@
"revision": "64cfbc213f5a83da17632c95382a5a0a2f3357c1"
},
"pascal": {
"revision": "a9ee969dec5b2e3b2ccccc5954fec04100c7619e"
"revision": "d0ebabefaea9ac3f6fc3004cf08cd121b66da9e4"
},
"passwd": {
"revision": "20239395eacdc2e0923a7e5683ad3605aee7b716"
@ -507,13 +519,13 @@
"revision": "217ff2af3f2db15a79ab7e3d21ea1e0c17e71a1a"
},
"perl": {
"revision": "309cb8d33bcfd0a81050b21be08f9eb3f2fe2138"
"revision": "05d6a22c903ab7d12e93a039332ad6687c8c7b7d"
},
"php": {
"revision": "575a0801f430c8672db70b73493c033a9dcfc328"
"revision": "d13c91bc48aedf7db8240c52503eee694134ec53"
},
"php_only": {
"revision": "575a0801f430c8672db70b73493c033a9dcfc328"
"revision": "d13c91bc48aedf7db8240c52503eee694134ec53"
},
"phpdoc": {
"revision": "1d0e255b37477d0ca46f1c9e9268c8fa76c0b3fc"
@ -525,7 +537,7 @@
"revision": "bd860a0f57f697162bf28e576674be9c1500db5e"
},
"pod": {
"revision": "39da859947b94abdee43e431368e1ae975c0a424"
"revision": "0bf8387987c21bf2f8ed41d2575a8f22b139687f"
},
"poe_filter": {
"revision": "592476d81f95d2451f2ca107dc872224c76fecdf"
@ -533,6 +545,9 @@
"pony": {
"revision": "73ff874ae4c9e9b45462673cbc0a1e350e2522a7"
},
"powershell": {
"revision": "fc15514b2f1dbba9c58528d15a3708f89eda6a01"
},
"printf": {
"revision": "0e0aceabbf607ea09e03562f5d8a56f048ddea3d"
},
@ -540,10 +555,10 @@
"revision": "eca2596a355b1a9952b4f80f8f9caed300a272b5"
},
"problog": {
"revision": "d8bc22c007825d3af3d62b4326f9d8f9ca529974"
"revision": "93c69d2f84d8a167c0a3f4a8d51ccefe365a4dc8"
},
"prolog": {
"revision": "d8bc22c007825d3af3d62b4326f9d8f9ca529974"
"revision": "93c69d2f84d8a167c0a3f4a8d51ccefe365a4dc8"
},
"promql": {
"revision": "77625d78eebc3ffc44d114a07b2f348dff3061b0"
@ -573,7 +588,7 @@
"revision": "be062582956165019d3253794b4d712f66dfeaaa"
},
"python": {
"revision": "0dee05ef958ba2eae88d1e65f24b33cad70d4367"
"revision": "346fa42dc2990d2a2736cc60891369d0d3d8e65c"
},
"ql": {
"revision": "42becd6f8f7bae82c818fa3abb1b6ff34b552310"
@ -582,7 +597,7 @@
"revision": "6b2b5e41734bd6f07ea4c36ac20fb6f14061c841"
},
"qmljs": {
"revision": "febf48a5b6928600cd8fb2a01254743af550780d"
"revision": "cc4186f15e2829385be33440561fdd17b1c40cf7"
},
"query": {
"revision": "f767fb0ac5e711b6d44c5e0c8d1f349687a86ce0"
@ -591,7 +606,7 @@
"revision": "b1e211f52ad8f8e1e182bbbcc16dcd5e3688eb7d"
},
"racket": {
"revision": "171f52a8c0ed635b85cd42d1e36d82f1066a03b4"
"revision": "24dbb1dfc08e0f99dfbd0eddc5e73ef307f538dc"
},
"ralph": {
"revision": "f6d81bf7a4599c77388035439cf5801cd461ff77"
@ -617,6 +632,9 @@
"requirements": {
"revision": "5ad9b7581b3334f6ad492847d007f2fac6e6e5f2"
},
"rescript": {
"revision": "4606cd81c4c31d1d02390fee530858323410a74c"
},
"rnoweb": {
"revision": "1a74dc0ed731ad07db39f063e2c5a6fe528cae7f"
},
@ -627,7 +645,7 @@
"revision": "8e3a4205b76236bb6dbebdbee5afc262ce38bb62"
},
"roc": {
"revision": "6ea64b6434a45472bd87b0772fd84a017de0a557"
"revision": "ef46edd0c03ea30a22f7e92bc68628fb7231dc8a"
},
"ron": {
"revision": "78938553b93075e638035f624973083451b29055"
@ -636,28 +654,31 @@
"revision": "5120f6e59284cb8b85b450bd2db0bd352635ba9f"
},
"ruby": {
"revision": "0ffe457fb6aabf064f173fd30ea356845cef2513"
"revision": "7dbc1e2d0e2d752577655881f73b4573f3fe85d4"
},
"rust": {
"revision": "9c84af007b0f144954adb26b3f336495cbb320a7"
"revision": "2b43eafe64470846cdaa0eaae1e287c120ee5f03"
},
"scala": {
"revision": "a13f2d1ee9609cc5c4c8ffce9640c353b77a24d8"
"revision": "dd7fe4d7838ca751f5259718658dd309d999855b"
},
"scfg": {
"revision": "a5512800ea0220da4abbae61b8aea8423d1549aa"
},
"scheme": {
"revision": "8f9dff3d038f09934db5ea113cebc59c74447743"
"revision": "432c338093c69222efbeb124feb90715da306cc7"
},
"scss": {
"revision": "c478c6868648eff49eb04a4df90d703dc45b312a"
},
"sflog": {
"revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59"
},
"slang": {
"revision": "ea77a4d91dd93f4483965efcc41f3faebb9131c8"
"revision": "d84b43d75d65bbc4ba57166ce17555f32c0b8983"
},
"slint": {
"revision": "4a0558cc0fcd7a6110815b9bbd7cc12d7ab31e74"
"revision": "34ccfd58d3baee7636f62d9326f32092264e8407"
},
"smali": {
"revision": "fdfa6a1febc43c7467aa7e937b87b607956f2346"
@ -666,25 +687,25 @@
"revision": "fa898ac0885d1da9a253695c3e0e91f5efc587cd"
},
"snakemake": {
"revision": "46d4de8e6cfca8a97c0489aea936bb15beeaf666"
"revision": "e909815acdbe37e69440261ebb1091ed52e1dec6"
},
"solidity": {
"revision": "ee5a2d2ba30b487c4bbf613d2ef310a454c09c7c"
},
"soql": {
"revision": "c99ad4b16d112fea91745e3f1b769754239fdaba"
"revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59"
},
"sosl": {
"revision": "c99ad4b16d112fea91745e3f1b769754239fdaba"
"revision": "602cc4b050ef1e14a69acc2ea094968bf928fa59"
},
"sourcepawn": {
"revision": "645d093763bcaaf7535edbdf6575a5c978b16491"
"revision": "6b9bf9cbab91443380d2ca8a2f6c491cc7fac5bf"
},
"sparql": {
"revision": "d853661ca680d8ff7f8d800182d5782b61d0dd58"
},
"sql": {
"revision": "89fd00d0aff3bc9985ac37caf362ec4fd9b2ba1d"
"revision": "a8b10c76759a372d0f92bb070b4f5c993e0ce5f9"
},
"squirrel": {
"revision": "072c969749e66f000dba35a33c387650e203e96e"
@ -699,7 +720,7 @@
"revision": "d819cdd5dbe455bd3c859193633c8d91c0df7c36"
},
"styled": {
"revision": "65835cca33a5f033bcde580ed66cde01c1fabbbe"
"revision": "b729198642b3058d4ea0f864d86efb271d594595"
},
"supercollider": {
"revision": "affa4389186b6939d89673e1e9d2b28364f5ca6f"
@ -711,16 +732,16 @@
"revision": "7ab8221e3f378a3b04b4b488f07c1f408c5bd0d8"
},
"swift": {
"revision": "b3dc8cc5c266effd7bcfde01aa086b83927f2eda"
"revision": "5254a12fae5ddcb62ca8cbf57eca83c1c41cd884"
},
"sxhkdrc": {
"revision": "440d5f913d9465c9c776a1bd92334d32febcf065"
},
"systemtap": {
"revision": "1af543a96d060b1f808982037bfc54cc02218edd"
"revision": "f2b378a9af0b7e1192cff67a5fb45508c927205d"
},
"systemverilog": {
"revision": "a478beb76be72fa8f305f5fe9cc6141ac91b91a4"
"revision": "4f897d5e3f0e38bf8fbb55e8f39dc97d2bc2229e"
},
"t32": {
"revision": "6182836f4128725f1e74ce986840d7317021a015"
@ -729,7 +750,7 @@
"revision": "b1170880c61355aaf38fc06f4af7d3c55abdabc4"
},
"tact": {
"revision": "91cc49a83f4f0b3a756bf7d0e65403a9cf757003"
"revision": "b3710fe2723bd9b285de7f3d0c0717bebf3f17bd"
},
"tcl": {
"revision": "8784024358c233efd0f3a6fd9e7a3c5852e628bc"
@ -738,7 +759,7 @@
"revision": "19b02da829d1721a521bf7b802eb80a50bd53aab"
},
"templ": {
"revision": "de0d0ee129cf643872e8e0d5c4a6589b5a3aae23"
"revision": "5c19fba6dc99315d02160ed928bbc5cd8ac9ffe1"
},
"terraform": {
"revision": "9e3ec9848f28d26845ba300fd73c740459b83e9b"
@ -756,7 +777,7 @@
"revision": "bba02e79f85e335f310fc95e21c677e49f2c4439"
},
"tmux": {
"revision": "9138ea508410e0f34da2666609f600f65e944f22"
"revision": "0252ecd080016e45e6305ef1a943388f5ae2f4b4"
},
"todotxt": {
"revision": "3937c5cd105ec4127448651a21aef45f52d19609"
@ -780,13 +801,13 @@
"revision": "198d03553f43a45b92ac5d0ee167db3fec6a6fd6"
},
"typespec": {
"revision": "28821d0d6da5f0a6b5eb02b9bad953fecafd7248"
"revision": "0ee05546d73d8eb64635ed8125de6f35c77759fe"
},
"typoscript": {
"revision": "43b221c0b76e77244efdaa9963e402a17c930fbc"
},
"typst": {
"revision": "90f6af21271dee246a9cafe109e2b456c5bc10a6"
"revision": "abe60cbed7986ee475d93f816c1be287f220c5d8"
},
"udev": {
"revision": "8f58696e79092b4ad6bf197415bbd0970acf15cd"
@ -804,7 +825,7 @@
"revision": "ad9b638b914095320de85d59c49ab271603af048"
},
"v": {
"revision": "7f80a0441ff2ca6aa8ced8e1ee87cead9dd26515"
"revision": "a18d695ec105f0cda1903d1974f493207e122b35"
},
"vala": {
"revision": "8f690bfa639f2b83d1fb938ed3dd98a7ba453e8b"
@ -816,17 +837,20 @@
"revision": "075ebfc84543675f12e79a955f79d717772dcef3"
},
"vhdl": {
"revision": "4ab3e251eae8890a020d083d00acd1b8c2653c07"
"revision": "3f13cd14952b39ccf6817f58880834b84565ca54"
},
"vhs": {
"revision": "90028bbadb267ead5b87830380f6a825147f0c0f"
"revision": "09f8fbfe40a3a699b200daca7d92e65fbbe9f9e6"
},
"vim": {
"revision": "b448ca63f972ade12c373c808acdd2bf972937db"
"revision": "f3cd62d8bd043ef20507e84bb6b4b53731ccf3a7"
},
"vimdoc": {
"revision": "2249c44ecd3f5cf22da3dcccfb74f816ddb29245"
},
"vrl": {
"revision": "274b3ce63f72aa8ffea18e7fc280d3062d28f0ba"
},
"vue": {
"revision": "22bdfa6c9fc0f5ffa44c6e938ec46869ac8a99ff"
},
@ -840,7 +864,7 @@
"revision": "bd1d35cf3e013dc7e189b46a593bdc2b281b0dd7"
},
"wit": {
"revision": "cd7e6534fd9a22e3e9a7a85feecf4e35461e47cb"
"revision": "c52f0b07786603df17ad0197f6cef680f312eb2c"
},
"xcompose": {
"revision": "fff3e72242aa110ebba6441946ea4d12d200fa68"
@ -858,9 +882,9 @@
"revision": "e877f6ade4b77d5ef8787075141053631ba12318"
},
"zathurarc": {
"revision": "6e7c8edfcd6f5f7c12b2fa9ffc6d042f1b6d7068"
"revision": "0554b4a5d313244b7fc000cbb41c04afae4f4e31"
},
"zig": {
"revision": "2bac4cc6c697d46a193905fef6d003bfa0bfabfd"
"revision": "21e2218e0ec7f4e3c0640d16bf8c67e6f0a61e18"
}
}

View File

@ -98,7 +98,7 @@ list.apex = {
files = { "src/parser.c" },
location = "apex",
},
maintainers = { "@aheber" },
maintainers = { "@aheber", "@xixiaofinland" },
}
list.arduino = {
@ -633,6 +633,24 @@ list.fusion = {
maintainers = { "@jirgn" },
}
list.gap = {
install_info = {
url = "https://github.com/gap-system/tree-sitter-gap",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@reiniscirpons" },
readme_name = "GAP system",
}
list.gaptst = {
install_info = {
url = "https://github.com/gap-system/tree-sitter-gaptst",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@reiniscirpons" },
readme_name = "GAP system test files",
}
list.gdscript = {
install_info = {
url = "https://github.com/PrestonKnopp/tree-sitter-gdscript",
@ -704,7 +722,7 @@ list.gleam = {
list.glimmer = {
install_info = {
url = "https://github.com/alexlafroscia/tree-sitter-glimmer",
url = "https://github.com/ember-tooling/tree-sitter-glimmer",
files = { "src/parser.c", "src/scanner.c" },
},
filetype = "handlebars",
@ -712,6 +730,26 @@ list.glimmer = {
readme_name = "Glimmer and Ember",
}
list.glimmer_javascript = {
install_info = {
url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-javascript",
files = { "src/parser.c", "src/scanner.c" },
generate_requires_npm = true,
},
filetype = "javascript.glimmer",
maintainers = { "@NullVoxPopuli" },
}
list.glimmer_typescript = {
install_info = {
url = "https://github.com/NullVoxPopuli/tree-sitter-glimmer-typescript",
files = { "src/parser.c", "src/scanner.c" },
generate_requires_npm = true,
},
filetype = "typescript.glimmer",
maintainers = { "@NullVoxPopuli" },
}
list.glsl = {
install_info = {
url = "https://github.com/theHamsta/tree-sitter-glsl",
@ -1495,7 +1533,7 @@ list.php = {
location = "php",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@tk-shirasaka" },
maintainers = { "@tk-shirasaka", "@calebdw" },
}
list.php_only = {
@ -1504,7 +1542,7 @@ list.php_only = {
location = "php_only",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@tk-shirasaka" },
maintainers = { "@tk-shirasaka", "@calebdw" },
}
-- Parsers for injections
@ -1562,6 +1600,15 @@ list.pony = {
maintainers = { "@amaanq", "@mfelsche" },
}
list.powershell = {
install_info = {
url = "https://github.com/airbus-cert/tree-sitter-powershell",
files = { "src/parser.c", "src/scanner.c" },
},
filetype = "ps1",
maintainers = { "@L2jLiga" },
}
list.printf = {
install_info = {
url = "https://github.com/ObserverOfTime/tree-sitter-printf",
@ -1795,6 +1842,14 @@ list.requirements = {
readme_name = "pip requirements",
}
list.rescript = {
install_info = {
url = "https://github.com/rescript-lang/tree-sitter-rescript",
files = { "src/parser.c", "src/scanner.c" },
},
maintainers = { "@ribru17" },
}
list.rnoweb = {
install_info = {
url = "https://github.com/bamonroe/tree-sitter-rnoweb",
@ -1891,6 +1946,15 @@ list.scss = {
maintainers = { "@elianiva" },
}
list.sflog = {
install_info = {
url = "https://github.com/aheber/tree-sitter-sfapex",
files = { "src/parser.c" },
location = "sflog",
},
maintainers = { "@aheber", "@xixiaofinland" },
}
list.slang = {
install_info = {
url = "https://github.com/theHamsta/tree-sitter-slang",
@ -1949,7 +2013,7 @@ list.soql = {
files = { "src/parser.c" },
location = "soql",
},
maintainers = { "@aheber" },
maintainers = { "@aheber", "@xixiaofinland" },
}
list.sosl = {
@ -1958,7 +2022,7 @@ list.sosl = {
files = { "src/parser.c" },
location = "sosl",
},
maintainers = { "@aheber" },
maintainers = { "@aheber", "@xixiaofinland" },
}
list.sourcepawn = {
@ -2381,6 +2445,14 @@ list.vimdoc = {
maintainers = { "@clason" },
}
list.vrl = {
install_info = {
url = "https://github.com/belltoy/tree-sitter-vrl",
files = { "src/parser.c" },
},
maintainers = { "@belltoy" },
}
list.vue = {
install_info = {
url = "https://github.com/tree-sitter-grammars/tree-sitter-vue",
@ -2474,10 +2546,10 @@ list.zathurarc = {
list.zig = {
install_info = {
url = "https://github.com/maxxnino/tree-sitter-zig",
url = "https://github.com/tree-sitter-grammars/tree-sitter-zig",
files = { "src/parser.c" },
},
maintainers = { "@maxxnino" },
maintainers = { "@amaanq" },
}
list.templ = {

View File

@ -248,7 +248,7 @@ function M.iter_prepared_matches(query, qnode, bufnr, start_row, end_row)
return t
end
local matches = query:iter_matches(qnode, bufnr, start_row, end_row)
local matches = query:iter_matches(qnode, bufnr, start_row, end_row, { all = false })
local function iterator()
local pattern, match, metadata = matches()

View File

@ -1,5 +1,6 @@
local fn = vim.fn
local utils = require "nvim-treesitter.utils"
local uv = vim.uv or vim.loop
-- Convert path for cmd.exe on Windows.
-- This is needed when vim.opt.shellslash is in use.
@ -292,7 +293,7 @@ function M.select_download_commands(repo, project_name, cache_folder, revision,
-- Running `git clone` or `git checkout` while running under Git (such as
-- editing a `git commit` message) will likely fail to install parsers
-- (such as 'gitcommit') and can also corrupt the index file of the current
-- Git repository. Check for typical git environemnt variables and abort if found.
-- Git repository. Check for typical git environment variables and abort if found.
for _, k in pairs {
"GIT_ALTERNATE_OBJECT_DIRECTORIES",
"GIT_CEILING_DIRECTORIES",
@ -303,10 +304,11 @@ function M.select_download_commands(repo, project_name, cache_folder, revision,
"GIT_PREFIX",
"GIT_WORK_TREE",
} do
if vim.uv.os_getenv(k) then
if uv.os_getenv(k) then
vim.api.nvim_err_writeln(
string.format(
"Cannot install %s with git in an active git session. Exit the session and run ':TSInstall %s' manually",
project_name,
project_name
)
)

View File

@ -1,6 +1,6 @@
; Lower priority to prefer @variable.parameter when identifier appears in parameter_declaration.
((identifier) @variable
(#set! "priority" 95))
(#set! priority 95))
(preproc_def
(preproc_arg) @variable)

View File

@ -358,6 +358,9 @@
(preproc_pragma
(identifier) @constant)
(preproc_if
(identifier) @constant)
[
"if"
"else"
@ -367,15 +370,6 @@
"when"
] @keyword.conditional
(preproc_pragma
(identifier) @constant)
(preproc_if
(identifier) @constant)
(preproc_if
(identifier) @constant)
[
"while"
"for"

View File

@ -11,7 +11,7 @@
; have multiple highlight groups applied to them.
; >> Literals
((dis_expr) @comment
(#set! "priority" 105)
(#set! priority 105)
; Higher priority to mark the whole sexpr as a comment
)

View File

@ -3,11 +3,12 @@
((call_expression
(type) @_printf
(arguments
(named_arguments
"("
.
(expression
(string_literal) @injection.content)))
(named_argument
(expression
(string_literal) @injection.content))))
(#eq? @_printf "printf")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "printf"))

View File

@ -12,7 +12,7 @@
(module_def
(module_declaration
(module_fqn) @local.definition.namespace)
(#set! "definition.namespace.scope" "global"))
(#set! definition.namespace.scope "global"))
(enum_declaration
(enum_member

View File

@ -22,7 +22,7 @@
(raw_block)
(frontmatter)
] @markup.raw.block
(#set! "priority" 90))
(#set! priority 90))
; Remove @markup.raw for code with a language spec
(code_block
@ -30,7 +30,7 @@
(code_block_marker_begin)
(language)
(code) @none
(#set! "priority" 90))
(#set! priority 90))
[
(code_block_marker_begin)
@ -204,12 +204,12 @@
(#set! conceal ""))
((math) @markup.math
(#set! "priority" 90))
(#set! priority 90))
(verbatim) @markup.raw
((raw_inline) @markup.raw
(#set! "priority" 90))
(#set! priority 90))
(comment
"%" @comment

View File

@ -43,7 +43,7 @@
((heredoc_block
(heredoc_line) @string)
(#set! "priority" 90))
(#set! priority 90))
(expansion
[

View File

@ -1,5 +1,5 @@
((tag_name) @keyword
(#set! "priority" 105))
(#set! priority 105))
[
"@code"

View File

@ -69,7 +69,7 @@
(ExternalID
(SystemLiteral
(URI) @string.special.url))
(#set! "priority" 105))
(#set! priority 105))
; Attlist declaration
(AttlistDecl

View File

@ -43,10 +43,6 @@
(statement_identifier) @label
(glimmer_opening_tag) @tag.builtin
(glimmer_closing_tag) @tag.builtin
; Function and method definitions
;--------------------------------
(function_expression
@ -132,11 +128,6 @@
(new_expression
constructor: (identifier) @constructor)
; Variables
;----------
(namespace_import
(identifier) @module)
; Decorators
;----------
(decorator
@ -302,6 +293,19 @@
"}"
] @punctuation.special) @none
; Imports
;----------
(namespace_import
"*" @character.special
(identifier) @module)
(namespace_export
"*" @character.special
(identifier) @module)
(export_statement
"*" @character.special)
; Keywords
;----------
[

View File

@ -7,11 +7,7 @@
; html(`...`), html`...`, sql(`...`), etc.
(call_expression
function: [
(await_expression
(identifier) @injection.language)
(identifier) @injection.language
]
function: (identifier) @injection.language
arguments: [
(arguments
(template_string) @injection.content)
@ -27,13 +23,8 @@
; svg`...` or svg(`...`)
(call_expression
function: [
(await_expression
(identifier) @_name
(#eq? @_name "svg"))
((identifier) @_name
(#eq? @_name "svg"))
]
function: (identifier) @_name
(#eq? @_name "svg")
arguments: [
(arguments
(template_string) @injection.content)
@ -43,48 +34,44 @@
(#set! injection.include-children)
(#set! injection.language "html"))
; Vercel PostgreSQL
; foo.sql`...` or foo.sql(`...`)
(call_expression
function: [
(await_expression
(identifier) @_name
(#eq? @_name "gql"))
((identifier) @_name
(#eq? @_name "gql"))
function: (member_expression
property: (property_identifier) @injection.language)
arguments: [
(arguments
(template_string) @injection.content)
(template_string) @injection.content
]
arguments: ((template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "graphql")))
(#eq? @injection.language "sql")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children))
(call_expression
function: [
(await_expression
(identifier) @_name
(#eq? @_name "hbs"))
((identifier) @_name
(#eq? @_name "hbs"))
]
arguments: ((template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "glimmer")))
function: (identifier) @_name
(#eq? @_name "gql")
arguments: (template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "graphql"))
((glimmer_template) @injection.content
(call_expression
function: (identifier) @_name
(#eq? @_name "hbs")
arguments: (template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "glimmer"))
; css`<css>`, keyframes`<css>`
(call_expression
function: [
(await_expression
(identifier) @_name
(#any-of? @_name "css" "keyframes"))
((identifier) @_name
(#any-of? @_name "css" "keyframes"))
]
arguments: ((template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "styled")))
function: (identifier) @_name
(#any-of? @_name "css" "keyframes")
arguments: (template_string) @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children)
(#set! injection.language "styled"))
; styled.div`<css>`
(call_expression

View File

@ -1,8 +1,7 @@
(comment) @comment @spell
; consistency with toml and ini
(section
(section_name) @type)
(section_name) @string.special.path)
(character_choice
(character) @constant)

View File

@ -1,5 +1,5 @@
((atom) @constant
(#set! "priority" "90"))
(#set! priority "90"))
(var) @variable
@ -86,15 +86,15 @@
; Macros
((macro_call_expr) @constant.macro
(#set! "priority" 101))
(#set! priority 101))
; Preprocessor
(pp_define
lhs: _ @constant.macro
(#set! "priority" 101))
(#set! priority 101))
(_preprocessor_directive) @keyword.directive
(#set! "priority" 99)
(#set! priority 99)
; Attributes
(pp_include) @keyword.import
@ -108,7 +108,7 @@
(export_type_attribute
types: (fa
fun: _ @type
(#set! "priority" 101)))
(#set! priority 101)))
(behaviour_attribute) @keyword.import

View File

@ -90,7 +90,7 @@
] @variable.member
((field_id) @variable.member
(#set! "priority" 105))
(#set! priority 105))
(port
(identifier) @variable.member)

View File

@ -0,0 +1,12 @@
[
(if_statement)
(elif_clause)
(else_clause)
(while_statement)
(repeat_statement)
(for_statement)
(atomic_statement)
(lambda)
(function)
(atomic_function)
] @fold

View File

@ -0,0 +1,208 @@
(identifier) @variable
; Functions
(assignment_statement
left: (identifier) @function
right: (function))
(assignment_statement
left: (identifier) @function
right: (atomic_function))
(assignment_statement
left: (identifier) @function
right: (lambda))
(call
function: (identifier) @function.call)
((call
function: (identifier) @function.builtin)
(#any-of? @function.builtin "Assert" "Info" "IsBound" "Unbind" "TryNextMethod"))
(parameters
(identifier) @variable.parameter)
(qualified_parameters
(identifier) @variable.parameter)
(qualified_parameters
(qualified_identifier
(identifier) @variable.parameter))
(lambda_parameters
(identifier) @variable.parameter)
; arg is treated specially when it is the only parameter of a function
((parameters
.
(identifier) @variable.parameter.builtin .)
(#eq? @variable.parameter.builtin "arg"))
((qualified_parameters
.
(identifier) @variable.parameter.builtin .)
(#eq? @variable.parameter.builtin "arg"))
((qualified_parameters
.
(qualified_identifier
(identifier) @variable.parameter.builtin) .)
(#eq? @variable.parameter.builtin "arg"))
((lambda_parameters
.
(identifier) @variable.parameter.builtin .)
(#eq? @variable.parameter.builtin "arg"))
; Literals
(bool) @constant.builtin
(integer) @number
(float) @number.float
(string) @string
(char) @character
(escape_sequence) @string.escape
[
(help_topic)
(help_book)
] @string.special
(tilde) @variable.builtin
; Record selectors
(record_entry
left: [
(identifier)
(integer)
] @variable.member)
(record_selector
selector: [
(identifier)
(integer)
] @variable.member)
(component_selector
selector: [
(identifier)
(integer)
] @variable.member)
(function_call_option
[
(identifier)
(record_entry ;Record entries specify global properties in function calls
left: [
(identifier)
(integer)
])
] @property)
(help_statement
(help_selector) @property)
; Operators
[
"+"
"-"
"*"
"/"
"^"
"->"
":="
"<"
"<="
"<>"
"="
">"
">="
".."
(ellipsis)
] @operator
(help_statement
(help_operator) @operator)
; Keywords
[
(break_statement)
(continue_statement)
"atomic"
(quit_statement)
] @keyword
[
"function"
"local"
"end"
] @keyword.function
[
"and"
"in"
"mod"
"not"
"or"
] @keyword.operator
"rec" @keyword.type
[
"readonly"
"readwrite"
] @keyword.modifier
(atomic_function
"atomic" @keyword.modifier)
[
"for"
"while"
"do"
"od"
"repeat"
"until"
] @keyword.repeat
[
"if"
"then"
"elif"
"else"
"fi"
] @keyword.conditional
"return" @keyword.return
(pragma) @keyword.directive
;Punctuation
[
","
";"
"."
"!."
":"
] @punctuation.delimiter
[
"("
")"
"["
"!["
"]"
"{"
"}"
] @punctuation.bracket
(help_statement
"?" @punctuation.special)
;Comments
(comment) @comment @spell

View File

@ -0,0 +1,2 @@
((comment) @injection.content
(#set! injection.language "comment"))

View File

@ -0,0 +1,43 @@
[
(lambda)
(function)
(atomic_function)
] @local.scope
(parameters
(identifier) @local.definition.parameter)
(qualified_parameters
(identifier) @local.definition.parameter)
(qualified_parameters
(qualified_identifier
(identifier) @local.definition.parameter))
(lambda_parameters
(identifier) @local.definition.parameter)
(locals
(identifier) @local.definition.var)
(record_entry
left: [
(identifier)
(integer)
] @local.definition.field)
(assignment_statement
left: (identifier) @local.definition.var)
(for_statement
identifier: (identifier) @local.definition.var)
(assignment_statement
left: (identifier) @local.definition.function
right: [
(lambda)
(function)
(atomic_function)
])
(identifier) @local.reference

View File

@ -0,0 +1,7 @@
[
(if_statement)
(else_clause)
(local_statement)
(exec_statement)
(test_case)
] @fold

View File

@ -0,0 +1,19 @@
(output_line) @markup.raw.block
[
"#@local"
"#@exec"
] @keyword
[
"gap> "
"> "
] @keyword.debug
[
"#@if"
"#@else"
"#@fi"
] @keyword.conditional
(comment) @comment @spell

View File

@ -0,0 +1,9 @@
((comment) @injection.content
(#set! injection.language "comment"))
((gap_expression) @injection.content
(#set! injection.language "gap"))
((input_line) @injection.content
(#set! injection.language "gap")
(#set! injection.combined))

View File

@ -48,7 +48,7 @@
; Function Definition
((function_definition
(name) @local.definition.function)
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
; Lambda
; lambda names are not accessible and are only for debugging.
@ -74,7 +74,7 @@
; Class
((class_definition
(name) @local.definition.type)
(#set! "definition.type.scope" "parent"))
(#set! definition.type.scope "parent"))
(class_definition
(body
@ -102,7 +102,7 @@
(body
(function_definition
(name) @local.definition.method)))
(#set! "definition.method.scope" "parent"))
(#set! definition.method.scope "parent"))
; Enum
(enum_definition

View File

@ -1,5 +1,5 @@
; Sections
(section_name) @type
(section_name) @markup.heading
((section_name) @keyword.import
(#eq? @keyword.import "include"))

View File

@ -1,2 +1,21 @@
; comments
((comment_statement) @injection.content
(#set! injection.language "comment"))
; <style> tags
((element_node
(element_node_start
(tag_name) @_tag_name
(#eq? @_tag_name "style"))) @injection.content
(#offset! @injection.content 0 7 0 -8)
(#set! injection.language "css")
(#set! injection.include-children))
; <script> tags
((element_node
(element_node_start
(tag_name) @_tag_name
(#eq? @_tag_name "script"))) @injection.content
(#offset! @injection.content 0 8 0 -9)
(#set! injection.language "glimmer_javascript")
(#set! injection.include-children))

View File

@ -0,0 +1,61 @@
; inherits: ecma
(glimmer_opening_tag) @tag.builtin
(glimmer_closing_tag) @tag.builtin
; Copied from javascript
; Parameters
(formal_parameters
(identifier) @variable.parameter)
(formal_parameters
(rest_pattern
(identifier) @variable.parameter))
; ({ a }) => null
(formal_parameters
(object_pattern
(shorthand_property_identifier_pattern) @variable.parameter))
; ({ a = b }) => null
(formal_parameters
(object_pattern
(object_assignment_pattern
(shorthand_property_identifier_pattern) @variable.parameter)))
; ({ a: b }) => null
(formal_parameters
(object_pattern
(pair_pattern
value: (identifier) @variable.parameter)))
; ([ a ]) => null
(formal_parameters
(array_pattern
(identifier) @variable.parameter))
; ({ a } = { a }) => null
(formal_parameters
(assignment_pattern
(object_pattern
(shorthand_property_identifier_pattern) @variable.parameter)))
; ({ a = b } = { a }) => null
(formal_parameters
(assignment_pattern
(object_pattern
(object_assignment_pattern
(shorthand_property_identifier_pattern) @variable.parameter))))
; a => null
(arrow_function
parameter: (identifier) @variable.parameter)
; optional parameters
(formal_parameters
(assignment_pattern
left: (identifier) @variable.parameter))
; punctuation
(optional_chain) @punctuation.delimiter

View File

@ -0,0 +1,5 @@
; inherits: ecma
(glimmer_opening_tag) @indent.begin
(glimmer_closing_tag) @indent.end

View File

@ -0,0 +1,15 @@
; inherits: ecma
; Parse Ember/Glimmer/Handlebars/HTMLBars/etc. template literals
; e.g.: await render(hbs`<SomeComponent />`)
(call_expression
function: ((identifier) @_name
(#eq? @_name "hbs"))
arguments: ((template_string) @glimmer
(#offset! @glimmer 0 1 0 -1)))
; Ember Unified <template> syntax
; e.g.: <template><SomeComponent @arg={{double @value}} /></template>
((glimmer_template) @injection.content
(#set! injection.language "glimmer")
(#set! injection.include-children))

View File

@ -0,0 +1,6 @@
; inherits: typescript
; Sub-language delimeters
(glimmer_opening_tag) @tag.builtin
(glimmer_closing_tag) @tag.builtin

View File

@ -0,0 +1,3 @@
(glimmer_opening_tag) @indent.begin
(glimmer_closing_tag) @indent.end

View File

@ -0,0 +1,15 @@
; inherits: typescript
; Parse Ember/Glimmer/Handlebars/HTMLBars/etc. template literals
; e.g.: await render(hbs`<SomeComponent />`)
(call_expression
function: ((identifier) @_name
(#eq? @_name "hbs"))
arguments: ((template_string) @glimmer
(#offset! @glimmer 0 1 0 -1)))
; Ember Unified <template> syntax
; e.g.: <template><SomeComponent @arg={{double @value}} /></template>
((glimmer_template) @injection.content
(#set! injection.language "glimmer")
(#set! injection.include-children))

View File

@ -34,7 +34,7 @@
(import_spec_list
")" @indent.branch)
(var_declaration
(var_spec_list
")" @indent.branch)
[

View File

@ -148,6 +148,8 @@
"!"
] @operator
(wildcard_import) @character.special
(string
"/" @string)

View File

@ -39,7 +39,7 @@
((scoped_type_identifier
path: (_) @module)
(#set! "priority" 105))
(#set! priority 105))
; Keywords
[
@ -93,7 +93,7 @@
; Labels
((label) @label
(#set! "priority" 105))
(#set! priority 105))
; Functions
(function_declaration
@ -144,7 +144,7 @@
((member_expression
"."
(_) @variable.member)
(#set! "priority" 105))
(#set! priority 105))
(field
.

View File

@ -14,7 +14,8 @@
(if_statement
("("
condition: (_)")") @indent.begin)
condition: (_)
")") @indent.begin)
[
"}"

View File

@ -144,7 +144,8 @@
.
(decl
name: (variable) @variable)
match: (_)(#eq? @_name @variable))
match: (_)
(#eq? @_name @variable))
; but consider a type that involves 'IO' a decl/function
(decl/signature
@ -161,7 +162,8 @@
.
(decl
name: (variable) @function)
match: (_)(#eq? @_name @function))
match: (_)
(#eq? @_name @function))
((decl/signature) @function
.

View File

@ -7,7 +7,7 @@
((attribute
(quoted_attribute_value) @string)
(#set! "priority" 99))
(#set! priority 99))
(text) @none @spell
@ -93,7 +93,8 @@
(attribute_name) @_attr
(quoted_attribute_value
(attribute_value) @string.special.url))
(#any-of? @_attr "href" "src"))
(#any-of? @_attr "href" "src")
(#set! @string.special.url url @string.special.url))
[
"<"

View File

@ -1,50 +1,36 @@
; Keywords
(scheme) @module
; Methods
(method) @function.method
; Headers
(header
name: (name) @constant)
name: (_) @constant)
; Variables
(variable_declaration
name: (identifier) @variable)
; Fields
(pair
name: (identifier) @variable.member)
; URL / Host
(host) @string.special.url
(path
(identifier) @string.special.url)
; Parameters
(query_param
(key) @variable.parameter)
; Operators
[
"="
"?"
"&"
"@"
"<"
] @operator
(comment
"=" @operator)
(variable_declaration
"=" @operator)
; keywords
(comment
"@" @keyword
name: (_) @keyword)
; Literals
(target_url) @string.special.url
(request
url: (_) @string.special.url)
(http_version) @constant
(string) @string
; Response
(status_code) @number
(number) @number
(boolean) @boolean
(status_text) @string
; Punctuation
[
@ -52,11 +38,15 @@
"}}"
] @punctuation.bracket
":" @punctuation.delimiter
(header
":" @punctuation.delimiter)
; external JSON body
(external_body
file_path: (path) @string.special.path)
path: (_) @string.special.path)
; Comments
(comment) @comment @spell
[
(comment)
(request_separator)
] @comment @spell

View File

@ -9,9 +9,16 @@
((xml_body) @injection.content
(#set! injection.language "xml"))
((graphql_body) @injection.content
((graphql_data) @injection.content
(#set! injection.language "graphql"))
; Lua scripting
((script_variable) @injection.content
(#set! injection.language "lua"))
; Script (default to javascript)
((comment
name: (_) @_name
(#eq? @_name "lang")
value: (_) @injection.language)?
.
(_
(script) @injection.content
(#offset! @injection.content 0 2 0 -2))
(#set! injection.language "javascript"))

View File

@ -168,7 +168,7 @@
(preproc_call
directive: (preproc_directive) @keyword.directive
argument: (_) @constant)
argument: (_)? @constant)
(module_dcl
(identifier) @module)

View File

@ -1,5 +1,5 @@
(section_name
(text) @type) ; consistency with toml
(text) @markup.heading)
(comment) @comment @spell
@ -13,4 +13,4 @@
(setting
(setting_name) @property)
; (setting_value) @none ; grammar does not support subtypes
(setting_value) @string

View File

@ -1,2 +1,3 @@
((comment) @injection.content
((comment
(text) @injection.content)
(#set! injection.language "comment"))

View File

@ -141,6 +141,8 @@
(constant_pattern) @constant
(boolean_pattern) @boolean
; Types
(generic_type
name: _ @type)

View File

@ -257,6 +257,10 @@
"uses"
] @keyword.import
(import_declaration
(asterisk
"*" @character.special))
; Punctuation
[
";"

View File

@ -11,7 +11,7 @@
(field
function: (fieldname
(id) @local.definition.function)
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(bind
(id) @local.definition.var)

View File

@ -6,6 +6,7 @@
(abstract_definition)
(struct_definition)
(function_definition)
(macro_definition)
(assignment)
(const_statement)
]
@ -13,14 +14,27 @@
(#set! injection.language "markdown")
(#offset! @injection.content 0 3 0 -3))
; Inject comments
([
(line_comment)
(block_comment)
] @injection.content
(#set! injection.language "comment"))
; Inject regex in r"hello\bworld"
((prefixed_string_literal
prefix: (identifier) @_prefix) @injection.content
(#eq? @_prefix "r")
(#set! injection.language "regex")
(#offset! @injection.content 0 2 0 -1))
; Inject markdown in md"**Bold** and _Italics_"
((prefixed_string_literal
prefix: (identifier) @_prefix) @injection.content
(#eq? @_prefix "md")
(#set! injection.language "markdown")
(#offset! @injection.content 0 3 0 -1))
; Inject bash in `git add --help`
((command_literal) @injection.content
(#set! injection.language "bash"))

View File

@ -101,7 +101,7 @@
; Fallback highlighting for recipe bodies
(recipe
(recipe_body) @string
(#set! "priority" 90))
(#set! priority 90))
; Ref: https://just.systems/man/en/chapter_26.html
;(setting (identifier) @error)

View File

@ -58,13 +58,13 @@
(node
(node_comment)
(#set! "priority" 105)) @comment
(#set! priority 105)) @comment
(node
(node_field
(node_field_comment)
(#set! "priority" 105)) @comment)
(#set! priority 105)) @comment)
(node_children
(node_children_comment)
(#set! "priority" 105)) @comment
(#set! priority 105)) @comment

View File

@ -73,6 +73,8 @@
(import_header
"import" @keyword.import)
(wildcard_import) @character.special
; The last `simple_identifier` in a `import_header` will always either be a function
; or a type. Classes can appear anywhere in the import path, unlike functions
(import_header
@ -175,7 +177,7 @@
] @number
[
"null"
(null_literal)
; should be highlighted the same as booleans
(boolean_literal)
] @boolean

View File

@ -13,13 +13,13 @@
(function_declaration
.
(simple_identifier) @local.definition.function
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(class_body
(function_declaration
.
(simple_identifier) @local.definition.method)
(#set! "definition.method.scope" "parent"))
(#set! definition.method.scope "parent"))
; Variables
(function_declaration
@ -52,11 +52,11 @@
; Types
(class_declaration
(type_identifier) @local.definition.type
(#set! "definition.type.scope" "parent"))
(#set! definition.type.scope "parent"))
(type_alias
(type_identifier) @local.definition.type
(#set! "definition.type.scope" "parent"))
(#set! definition.type.scope "parent"))
; Scopes
[

View File

@ -1,26 +1,29 @@
; General syntax
(command_name) @function
(placeholder) @variable
(text_mode
[
"\\text"
"\\intertext"
"\\shortintertext"
] @function)
(command_name) @function @nospell
(caption
command: _ @function)
; Turn spelling on for text
(text) @spell
; \text, \intertext, \shortintertext, ...
(text_mode
command: _ @function @nospell
content: (curly_group
(_) @none @spell))
; Variables, parameters
(placeholder) @variable
(key_value_pair
key: (_) @variable.parameter
key: (_) @variable.parameter @nospell
value: (_))
[
(brack_group)
(brack_group_argc)
] @variable.parameter
(curly_group_spec
(text) @variable.parameter)
(brack_group_argc) @variable.parameter
[
(operator)
@ -33,6 +36,12 @@
(delimiter) @punctuation.delimiter
(math_delimiter
left_command: _ @punctuation.delimiter
left_delimiter: _ @punctuation.delimiter
right_command: _ @punctuation.delimiter
right_delimiter: _ @punctuation.delimiter)
[
"["
"]"
@ -44,46 +53,42 @@
(begin
command: _ @module
name: (curly_group_text
(text) @label))
(text) @label @nospell))
(end
command: _ @module
name: (curly_group_text
(text) @label))
(text) @label @nospell))
; Definitions and references
(new_command_definition
command: _ @function.macro
declaration: (curly_group_command_name
(_) @function))
command: _ @function.macro @nospell)
(old_command_definition
command: _ @function.macro
declaration: (_) @function)
command: _ @function.macro @nospell)
(let_command_definition
command: _ @function.macro
declaration: (_) @function)
command: _ @function.macro @nospell)
(environment_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text
(_) @markup.link))
(_) @label @nospell))
(theorem_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text_list
(_) @label))
(_) @label @nospell))
(paired_delimiter_definition
command: _ @function.macro
command: _ @function.macro @nospell
declaration: (curly_group_command_name
(_) @function))
(label_definition
command: _ @function.macro
name: (curly_group_text
(_) @markup.link))
(_) @markup.link @nospell))
(label_reference_range
command: _ @function.macro
@ -104,13 +109,19 @@
number: (_) @markup.link)
(citation
command: _ @function.macro
keys: (curly_group_text_list) @markup.link)
command: _ @function.macro @nospell
keys: (curly_group_text_list) @markup.link @nospell)
((hyperlink
command: _ @function @nospell
uri: (curly_group_uri
(_) @markup.link.url @nospell)) @_hyperlink
(#set! @_hyperlink url @markup.link.url))
(glossary_entry_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text
(_) @markup.link))
(_) @markup.link @nospell))
(glossary_entry_reference
command: _ @function.macro
@ -118,9 +129,9 @@
(_) @markup.link))
(acronym_definition
command: _ @function.macro
command: _ @function.macro @nospell
name: (curly_group_text
(_) @markup.link))
(_) @markup.link @nospell))
(acronym_reference
command: _ @function.macro
@ -137,26 +148,6 @@
name: (curly_group_text
(_) @markup.link))
; Formatting
(text_mode
content: (curly_group
(_) @none @spell))
(math_environment
(begin
command: _ @markup.math
name: (curly_group_text
(_) @markup.math)))
(math_environment
(_) @markup.math)
(math_environment
(end
command: _ @markup.math
name: (curly_group_text
(_) @markup.math)))
; Sectioning
(title_declaration
command: _ @module
@ -232,7 +223,7 @@
((generic_command
command: (command_name) @_name
arg: (curly_group
(text) @markup.heading))
(_) @markup.heading))
(#eq? @_name "\\frametitle"))
((generic_command
@ -247,11 +238,6 @@
(_) @markup.strong))
(#any-of? @_name "\\textbf" "\\mathbf"))
(hyperlink
command: _ @function @nospell
uri: (curly_group_uri
(_) @markup.link.url @nospell))
; File inclusion commands
(class_include
command: _ @keyword.import
@ -302,35 +288,39 @@
command: _ @keyword.import
paths: (curly_group_path_list) @string)
(text) @spell
(inline_formula) @nospell
(displayed_equation) @nospell
(key_value_pair) @nospell
(generic_environment
begin: _ @nospell
end: _ @nospell)
(citation
keys: _ @nospell)
(command_name) @nospell
(label_definition) @nospell
(label_reference) @nospell
(label_reference_range) @nospell
; Turn spelling off for whole nodes
[
(label_reference)
(label_reference_range)
(label_number)
(glossary_entry_reference)
(acronym_reference)
(color_definition)
(color_reference)
(class_include)
(package_include)
(latex_include)
(verbatim_include)
(import_include)
(bibstyle_include)
(bibtex_include)
(biblatex_include)
(graphics_include)
(svg_include)
(inkscape_include)
(tikz_library_import)
] @nospell
; Math
[
(displayed_equation)
(inline_formula)
] @markup.math
] @markup.math @nospell
(math_environment
(_) @markup.math)
; Comments
[
(line_comment)
(block_comment)

View File

@ -1,7 +1,3 @@
(variable_identifier) @variable
(constant_identifier) @constant
[
"assert"
"assert_eq"
@ -31,6 +27,10 @@
"self" @variable.builtin
"network" @variable.builtin
"async" @keyword.coroutine
[
"finalize"
"function"
@ -113,16 +113,21 @@
(boolean_literal) @boolean
(constant_declaration
(identifier) @constant)
(identifier
(constant_identifier) @constant))
[
(program_id)
(this_program_id)
] @string.special
(variable
(constant_identifier) @constant)
(associated_constant) @constant
(variable) @variable
(program_id) @string.special
;record declaration
(record_declaration
(identifier) @variable.member)
(identifier) @type.definition)
;struct component
(struct_component_declaration
@ -130,18 +135,26 @@
(type) @type
(associated_constant) @constant
[
(block_height)
(self_address)
(self_caller)
(self_signer)
(network_id)
] @constant.builtin
(free_function_call
(locator
(identifier) @function))
(associated_function_call
(named_type
(identifier
(constant_identifier) @function)))
(associated_function_call
(identifier) @function.call)
(record_type
(locator
(identifier) @variable.member))
@ -171,17 +184,16 @@
(identifier) @variable.parameter)
(struct_declaration
name: (identifier) @variable.member)
name: (identifier) @type.definition)
(variable_declaration
(identifier_or_identifiers
(identifier) @variable))
(identifier) @variable)
[
(address_literal)
(signature_literal)
((affine_group_literal)
(#set! "priority" 101))
(#set! priority 101))
(field_literal)
(product_group_literal)
(scalar_literal)
@ -189,4 +201,6 @@
(unsigned_literal)
] @number
(string_literal) @string
(annotation) @attribute

View File

@ -25,6 +25,7 @@
"as"
"assign"
"capture"
(custom_unpaired_statement)
"decrement"
"echo"
"endcapture"
@ -94,6 +95,7 @@
[
"include"
"include_relative"
"render"
"section"
"sections"

View File

@ -121,7 +121,7 @@
"["
"]"
] @type)
(#set! "priority" 105))
(#set! priority 105))
(type) @type

View File

@ -32,7 +32,11 @@
(negated_set
(character) @constant)
(class) @keyword
(class) @string.escape
(class
"%" @string.regexp
(escape_char) @string.regexp)
(negated_set
"^" @operator)

View File

@ -114,6 +114,22 @@
")"
] @operator)
(automatic_variable
"$"
_ @character.special
(#set! priority 105))
(automatic_variable
[
"$"
"("
")"
] @operator
(#set! priority 105))
(recipe_line
"@" @character.special)
(function_call
[
"subst"

View File

@ -45,7 +45,7 @@
(indented_code_block) @markup.raw.block
((fenced_code_block) @markup.raw.block
(#set! "priority" 90))
(#set! priority 90))
(fenced_code_block
(fenced_code_block_delimiter) @markup.raw.block
@ -103,13 +103,13 @@
(task_list_marker_checked) @markup.list.checked
((block_quote) @markup.quote
(#set! "priority" 90))
(#set! priority 90))
([
(plus_metadata)
(minus_metadata)
] @keyword.directive
(#set! "priority" 90))
(#set! priority 90))
[
(block_continuation)

View File

@ -43,7 +43,12 @@
(inline_link
(link_text) @_label
(link_destination) @_url
(#set! @_label "url" @_url))
(#set! @_label url @_url))
(image
(image_description) @_label
(link_destination) @_url
(#set! @_label url @_url))
; Conceal image links
(image
@ -88,6 +93,13 @@
(email_autolink)
] @markup.link.url @nospell
((link_destination) @_url
(#set! @_url url @_url))
((uri_autolink) @_url
(#offset! @_url 0 1 0 -1)
(#set! @_url url @_url))
(entity_reference) @nospell
; Replace common HTML entities.

View File

@ -211,3 +211,6 @@
(comment)
(line_continuation)
] @comment @spell
((comment) @keyword.directive
(#lua-match? @keyword.directive "^%%%% "))

View File

@ -4,7 +4,7 @@
; =============================================================================
; catch all rules
((identifier) @variable
(#set! "priority" 99))
(#set! priority 99))
; NOTE: we need priority, since (identifier) is most specific and we have to
; capture nodes containing (identifier) as a whole, while overruling the
@ -12,7 +12,7 @@
(type_expression) @type
; NOTE: has to be after
; ((identifier) @variable (#set! "priority" 99))
; ((identifier) @variable (#set! priority 99))
; overrule identifiers in pragmas in (proc_type)s and (pragma_expression)s
(proc_type
pragmas: (pragma_list) @variable)

View File

@ -33,7 +33,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(func_declaration
name: [
@ -44,7 +44,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(iterator_declaration
name: [
@ -55,7 +55,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
(converter_declaration
name: [
@ -66,7 +66,7 @@
(exported_symbol
(accent_quoted) @local.definition.function)
]
(#set! "definition.function.scope" "parent"))
(#set! definition.function.scope "parent"))
; ==============================================================================
; @local.definition.method ; methods
@ -79,7 +79,7 @@
(exported_symbol
(accent_quoted) @local.definition.method)
]
(#set! "definition.method.scope" "parent"))
(#set! definition.method.scope "parent"))
; ==============================================================================
; @local.definition.var ; variables
@ -193,7 +193,7 @@
(exported_symbol
(accent_quoted) @local.definition.macro)
]
(#set! "definition.macro.scope" "parent"))
(#set! definition.macro.scope "parent"))
(macro_declaration
name: [
@ -204,7 +204,7 @@
(exported_symbol
(accent_quoted) @local.definition.macro)
]
(#set! "definition.macro.scope" "parent"))
(#set! definition.macro.scope "parent"))
; ==============================================================================
; @local.definition.type ; types or classes

View File

@ -89,7 +89,7 @@
;----------
; Don't let normal parens take priority over this
((unit) @constant.builtin
(#set! "priority" 105))
(#set! priority 105))
(boolean) @boolean

View File

@ -64,7 +64,7 @@
"else"
"when"
] @keyword.conditional.ternary)
(#set! "priority" 105))
(#set! priority 105))
; Repeats
[

View File

@ -2,20 +2,31 @@
(pod) @fold
; fold the block-typed package statements only
; fold the block-typed package and class statements only
(package_statement
(block)) @fold
(class_statement
(block)) @fold
[
(subroutine_declaration_statement)
(method_declaration_statement)
(conditional_statement)
(loop_statement)
(for_statement)
(cstyle_for_statement)
(block_statement)
(defer_statement)
(phaser_statement)
] @fold
(try_statement
(block) @fold)
(eval_expression
(block) @fold)
(anonymous_subroutine_expression) @fold
; perhaps folks want to fold these too?

View File

@ -32,9 +32,18 @@
("continue" @keyword.repeat
(block))
[
"try"
"catch"
"finally"
] @keyword.exception
"return" @keyword.return
"sub" @keyword.function
[
"sub"
"method"
] @keyword.function
[
"map"
@ -42,14 +51,20 @@
"sort"
] @function.builtin
"package" @keyword.import
[
"package"
"class"
] @keyword.import
[
"defer"
"do"
"eval"
"my"
"our"
"local"
"state"
"field"
"last"
"next"
"redo"
@ -129,12 +144,18 @@
(package_statement
(package) @type)
(class_statement
(package) @type)
(require_expression
(bareword) @type)
(subroutine_declaration_statement
name: (bareword) @function)
(method_declaration_statement
name: (bareword) @function)
(attribute_name) @attribute
(attribute_value) @string
@ -270,4 +291,4 @@
")"
] @punctuation.bracket
; priority hack so nvim + ts-cli behave the same
(#set! "priority" 90))
(#set! priority 90))

View File

@ -221,10 +221,26 @@
(name) @type
(qualified_name
(name) @type)
alias: (name) @type.definition
])
(namespace_aliasing_clause
(name) @type.definition)
(namespace_use_clause
type: "function"
[
(name) @function
(qualified_name
(name) @function)
alias: (name) @function
])
(namespace_use_clause
type: "const"
[
(name) @constant
(qualified_name
(name) @constant)
alias: (name) @constant
])
(class_interface_clause
[
@ -369,9 +385,8 @@
name: (namespace_name
(name) @module))
(namespace_name_as_prefix
(namespace_name
(name) @module))
(namespace_name
(name) @module)
; Attributes
(attribute_list) @attribute

View File

@ -13,12 +13,13 @@
(match_block)
(case_statement)
(default_statement)
(property_hook_list)
] @indent.begin
(return_statement
[
(object_creation_expression)
(anonymous_function_creation_expression)
(anonymous_function)
(arrow_function)
(match_expression)
]) @indent.dedent
@ -49,6 +50,9 @@
(return_statement
";" @indent.end)
(property_hook_list
"}" @indent.end)
(ERROR
"(" @indent.align
.

View File

@ -12,7 +12,7 @@
name: (name) @local.definition.function) @local.scope
(#set! definition.function.scope "parent"))
(anonymous_function_creation_expression
(anonymous_function
(anonymous_function_use_clause
(variable_name
(name) @local.definition.var))) @local.scope

View File

@ -8,7 +8,7 @@
((command_paragraph
(command) @keyword
(content) @string)
(#set! "priority" 99))
(#set! priority 99))
(command_paragraph
(command) @keyword

View File

@ -133,7 +133,7 @@
((ffi_method
(string) @string.special)
(#set! "priority" 105))
(#set! priority 105))
(call_expression
callee: [

View File

@ -0,0 +1,13 @@
[
(expandable_here_string_literal)
(verbatim_here_string_characters)
(function_statement)
(param_block)
(script_block_expression)
(statement_block)
(switch_body)
(array_expression)
(hash_literal_expression)
(class_statement)
(class_method_definition)
] @fold

View File

@ -0,0 +1,334 @@
; Punctuation
;------------
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(hash_literal_expression
[
"@{"
"}"
] @punctuation.special)
(array_expression
[
"@("
")"
] @punctuation.special)
[
"."
"::"
","
";"
(empty_statement)
(command_argument_sep)
] @punctuation.delimiter
; Keywords
;---------
[
"if"
"elseif"
"else"
"switch"
] @keyword.conditional
[
"foreach"
"for"
"while"
"do"
"until"
"in"
"break"
"continue"
] @keyword.repeat
[
"function"
"filter"
"workflow"
"exit"
"trap"
"param"
"inlinescript"
] @keyword.function
"return" @keyword.return
[
"class"
"enum"
] @keyword.type
[
"data"
(class_attribute)
] @keyword.modifier
[
"throw"
"try"
"catch"
"finally"
] @keyword.exception
[
"parallel"
"sequence"
] @keyword.coroutine
[
"param"
"dynamicparam"
"begin"
"process"
"end"
] @keyword
; Operators
;----------
[
"-and"
"-or"
"-xor"
"-band"
"-bor"
"-bxor"
"+"
"-"
"/"
"\\"
"%"
"*"
".."
"-not"
"-bnot"
"!"
"="
"|"
(pre_increment_expression)
(pre_decrement_expression)
(post_increment_expression)
(post_decrement_expression)
(comparison_operator)
(assignement_operator)
] @operator
; Generic types
;--------------
(string_literal) @string
(integer_literal) @number
(real_literal) @number.float
(variable) @variable
((variable) @variable.builtin
(#any-of? @variable.builtin
"$$" "$?" "$^" "$_" "$args" "$ConsoleFileName" "$EnabledExperimentalFeatures" "$Error" "$Event"
"$EventArgs" "$EventSubscriber" "$ExecutionContext" "$false" "$foreach" "$HOME" "$Host" "$input"
"$IsCoreCLR" "$IsLinux" "$IsMacOS" "$IsWindows" "$LASTEXITCODE" "$Matches" "$MyInvocation"
"$NestedPromptLevel" "$null" "$PID" "$PROFILE" "$PSBoundParameters" "$PSCmdlet" "$PSCommandPath"
"$PSCulture" "$PSDebugContext" "$PSEdition" "$PSHOME" "$PSItem" "$PSScriptRoot" "$PSSenderInfo"
"$PSUICulture" "$PSVersionTable" "$PWD" "$Sender" "ShellId" "$StackTrace" "$switch" "$this"
"$true"))
((variable) @variable.builtin
(#lua-match? @variable.builtin "^\$env:"))
(data_name
(simple_name) @constant)
(comment) @comment @spell
((program
.
(comment) @keyword.directive)
(#lua-match? @keyword.directive "^#!/"))
; Booleans
;---------
([
(generic_token)
(command_name)
(variable)
(command)
] @boolean
(#any-of? @boolean "True" "False" "$true" "$false"))
; switch -regex
;--------------
(switch_statement
(switch_parameters
(switch_parameter) @_parameter)
(switch_body
(switch_clauses
(switch_clause
(switch_clause_condition
(string_literal) @string.regexp))))
(#eq? @_parameter "-regex")
(#offset! @string.regexp 0 1 0 -1))
; Multiline strings
;------------------
([
(verbatim_here_string_characters)
(expandable_here_string_literal)
] @markup.raw.block
(#offset! @markup.raw.block 0 2 0 -2))
; Type references and definitions
;--------------------------------
(type_spec
(type_name) @type)
(class_statement
(simple_name) @type)
(type_spec
(type_name) @type.builtin
(#any-of? @type.builtin
"bool" "Boolean" "System.Boolean" "char" "Char" "System.Char" "string" "String" "System.String"
"int" "Int32" "System.Int32" "long" "Int64" "System.Int64" "byte" "Byte" "System.Byte" "float"
"Single" "System.Single" "double" "Double" "System.Double" "decimal" "Decimal" "System.Decimal"
"array" "Array" "System.Array" "regex" "Regex" "System.Text.RegularExpressions.Regex" "ref"
"Management.Automation.PSReference" "System.Management.Automation.PSReference" "scriptblock"
"Management.Automation.ScriptBlock" "System.Management.Automation.ScriptBlock" "datetime"
"DateTime" "System.DateTime" "enum" "Enum" "System.Enum" "IO.DirectoryInfo"
"System.IO.DirectoryInfo" "IO.FileAttributes" "System.IO.FileAttributes" "IO.FileInfo"
"System.IO.FileInfo" "IO.Path" "System.IO.Path" "Text.RegularExpressions.RegexOptions"
"System.Text.RegularExpressions.RegexOptions" "Math" "System.Math" "PSObject" "System.PSObject"
"Object" "System.Object" "ValueType" "System.ValueType" "Hashtable"
"System.Collections.Hashtable" "Collections.Stack" "System.Collections.Generic.Stack"
"Collections.Dictionary" "System.Collections.Dictionary" "Collections.DictionaryEntry"
"System.Collections.DictionaryEntry" "Collections.ArrayList" "System.Collections.ArrayList"
"Management.Automation.SwitchParameter" "System.Management.Automation.SwitchParameter"
"Management.Automation.ActionPreference" "System.Management.Automation.ActionPreference"
"Management.Automation.ConfirmImpact" "System.Management.Automation.ConfirmImpact"
"Management.Automation.CommandInfo" "System.Management.Automation.CommandInfo"
"Management.Automation.ProviderInfo" "System.Management.Automation.ProviderInfo"
"Management.Automation.PSDriveInfo" "System.Management.Automation.PSDriveInfo"
"Management.Automation.PSVariable" "System.Management.Automation.PSVariable"
"Management.Automation.AliasInfo" "System.Management.Automation.AliasInfo"
"Management.Automation.PathInfo" "System.Management.Automation.PathInfo"
"Management.Automation.PathInfoStack" "System.Management.Automation.PathInfoStack"
"Management.Automation.ApplicationInfo" "System.Management.Automation.ApplicationInfo"
"Management.Automation.CmdletInfo" "System.Management.Automation.CmdletInfo"
"Management.Automation.ExternalScriptInfo" "System.Management.Automation.ExternalScriptInfo"
"Management.Automation.FunctionInfo" "System.Management.Automation.FunctionInfo"
"Management.Automation.CommandTypes" "System.Management.CommandTypes"
"Management.Automation.ScopedItemOptions" "System.Management.Automation.ScopedItemOptions"
"Management.Automation.PSTypeName" "System.Management.Automation.PSTypeName"
"Management.Automation.ParameterMetadata" "System.Management.Automation.ParameterMetadata"
"Management.Automation.CommandParameterSetInfo"
"System.Management.Automation.CommandParameterSetInfo"
"Management.Automation.SessionStateEntryVisibility"
"System.Management.Automation.SessionStateEntryVisibility" "Management.Automation.FilterInfo"
"System.Management.Automation.FilterInfo" "Management.Automation.ModuleType"
"System.Management.Automation.ModuleType" "Management.Automation.PSModuleInfo"
"System.Management.Automation.PSModuleInfo" "Management.Automation.PSCustomObject"
"System.Management.Automation.PSCustomObject" "Management.Automation.PSScriptCmdlet"
"System.Management.Automation.PSScriptCmdlet" "Management.Automation.ErrorRecord"
"System.Management.Automation.ErrorRecord" "Management.Automation.PSCredential"
"System.Management.Automation.PSCredential" "Management.Automation.PSMethod"
"System.Management.Automation.PSMethod")
)
; Function definitions
;---------------------
(function_statement
(function_name) @function)
; Classes, fields and methods definitions
;----------------------------------------
(class_property_definition
(variable) @variable.member)
(class_method_definition
(simple_name) @function.method)
(class_statement
(simple_name) @_class_name
(class_method_definition
(simple_name) @constructor)
(#eq? @constructor @_class_name))
(key_expression) @property
; Functions, methods calls and properties access
;--------------------------
(command_invokation_operator) @operator
(invokation_expression
(member_name) @function.call)
(invokation_expression
(member_name) @constructor
(#eq? @constructor "new"))
(member_access
(member_name
[
(simple_name)
(variable)
] @variable.member))
; Commands execution
;-------------------
(command
command_name: (command_name) @function.call)
(command
command_name: (command_name) @function.builtin
(#any-of? @function.builtin
; Locations & Paths
"cd" "cd.." "cd\\" "cd~" "help" "Get-Location" "Pop-Location" "Push-Location" "Set-Location"
"Convert-Path" "Join-Path" "Resolve-Path" "Split-Path" "Test-Path"
; Files & Directories
"Clear-Item" "Clear-ItemProperty" "Copy-Item" "Copy-ItemProperty" "Get-Item" "Get-ItemProperty"
"Get-ItemPropertyValue" "Invoke-Item" "Move-Item" "Move-ItemProperty" "New-Item"
"New-ItemProperty" "Remove-Item" "Remove-ItemProperty" "Rename-Item" "Rename-ItemProperty"
"Set-Item" "Set-ItemProperty"
; Aliases
"New-Alias" "Get-Alias" "Set-Alias" "Remove-Alias" "Import-Alias" "Export-Alias"
; Host (prompt)
"prompt" "cls" "echo" "Clear-Host" "Get-Host" "Out-Host" "Read-Host" "Write-Host" "Out-String"
; Expressions
"Invoke-Expression"
; Objects
"Compare-Object" "ForEach-Object" "Group-Object" "Measure-Object" "New-Object" "Select-Object"
"Sort-Object" "Tee-Object" "Where-Object"
; Modules
"Export-ModuleMember" "Find-Module" "Get-Module" "Import-Module" "Install-Module" "New-Module"
"New-ModuleManifest" "Publish-Module" "Remove-Module" "Save-Module" "Test-ModuleManifest"
"Uninstall-Module" "Update-Module" "Update-ModuleManifest"))
; Parameters and call arguments
;------------------------------
(command_elements
(generic_token) @variable.parameter)
(switch_parameter) @variable.parameter.builtin
(command_parameter) @variable.parameter.builtin
(script_parameter
(variable) @variable.parameter)
(class_method_parameter
(variable) @variable.parameter)
; Document encoding
;------------------
((program
.
(comment) @keyword.directive @nospell)
(#lua-match? @keyword.directive "Encoding$"))

View File

@ -0,0 +1,41 @@
(function_statement
"}" @indent.branch) @indent.begin
(param_block
[
"param"
"("
")"
] @indent.branch) @indent.begin
(script_block_expression
"}" @indent.branch) @indent.begin
(statement_block
"}" @indent.branch) @indent.begin
(switch_body
"}" @indent.branch) @indent.begin
(array_expression
")" @indent.branch) @indent.begin
(hash_literal_expression
"}" @indent.branch) @indent.begin
(class_statement
"}" @indent.branch) @indent.begin
(class_method_definition
"}" @indent.branch) @indent.begin
[
"}"
")"
] @indent.end
[
(comment)
(string_literal)
(ERROR)
] @indent.auto

View File

@ -0,0 +1,27 @@
; comments and block-comments
((comment) @injection.content
(#set! injection.language "comment"))
; dynamic invocation like & "$env:ChocolateyInstall\bin\choco.exe"
(command
(command_invokation_operator) @_operator
(command_name_expr
(string_literal) @injection.content)
(#eq? @_operator "&")
(#set! injection.language "powershell")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children))
; switch -regex
(switch_statement
(switch_parameters
(switch_parameter) @_parameter)
(switch_body
(switch_clauses
(switch_clause
(switch_clause_condition
(string_literal) @injection.content))))
(#eq? @_parameter "-regex")
(#set! injection.language "regex")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.include-children))

View File

@ -0,0 +1,85 @@
; Scopes
;-------
(class_statement) @local.scope
(class_method_definition) @local.scope
(statement_block) @local.scope
(function_statement) @local.scope
; Definitions
;------------
(class_statement
(simple_name) @local.definition.type
(#set! definition.var.scope "parent"))
(class_property_definition
(variable) @local.definition.field
(#set! definition.var.scope "parent"))
(class_method_definition
(simple_name) @local.definition.method
(#set! definition.var.scope "parent"))
(function_statement
(function_name) @local.definition.function
(#set! definition.var.scope "parent"))
; function, script block parameters
(parameter_list
(script_parameter
(attribute_list
(attribute
(type_literal
(type_spec) @local.definition.associated)))
(variable) @local.definition.parameter))
; variable assignment
(assignment_expression
(left_assignment_expression
(logical_expression
(bitwise_expression
(comparison_expression
(additive_expression
(multiplicative_expression
(format_expression
(range_expression
(array_literal_expression
(unary_expression
(variable) @local.definition.var)))))))))))
; variable with type assignment
(assignment_expression
(left_assignment_expression
(logical_expression
(bitwise_expression
(comparison_expression
(additive_expression
(multiplicative_expression
(format_expression
(range_expression
(array_literal_expression
(unary_expression
(expression_with_unary_operator
(cast_expression
(type_literal
(type_spec) @local.definition.associated)
(unary_expression
(variable) @local.definition.var))))))))))))))
; data sections
(data_name
(simple_name) @local.definition.var)
; References
;-----------
(variable) @local.reference
(command_name) @local.reference
(invokation_expression
(variable) @_variable
(member_name
(simple_name) @local.reference)
(#eq? @_variable "$this"))

View File

@ -0,0 +1,11 @@
[
(message_body)
(enum_body)
] @indent.begin
"}" @indent.end @indent.branch
[
(ERROR)
(comment)
] @indent.auto

View File

@ -59,7 +59,7 @@
; Decorators
((decorator
"@" @attribute)
(#set! "priority" 101))
(#set! priority 101))
(decorator
(identifier) @attribute)
@ -320,6 +320,9 @@
(aliased_import
"as" @keyword.import)
(wildcard_import
"*" @character.special)
[
"if"
"elif"

View File

@ -12,7 +12,7 @@
name: (identifier) @variable)
(field_definition
name: (identifier) @property)
name: (identifier) @variable.member)
(negated_field
"!" @operator
@ -33,7 +33,10 @@
")"
] @punctuation.bracket
":" @punctuation.delimiter
[
":"
"/"
] @punctuation.delimiter
[
"@"
@ -63,6 +66,15 @@
((comment) @keyword.directive @nospell
(#lua-match? @keyword.directive "^;+%s*format%-ignore%s*$"))
((predicate
name: (identifier) @_name
parameters: (parameters
.
(capture)?
.
(identifier) @property))
(#eq? @_name "set"))
((predicate
name: (identifier) @_name
parameters: (parameters

View File

@ -12,7 +12,12 @@
"]" @indent.branch @indent.end
")" @indent.end
[
")"
"?"
"*"
"+"
] @indent.end
; Captures always mark the end of a node
; Because of that, mark it as indent.end

View File

@ -1,28 +1,28 @@
((predicate
name: (identifier) @_name
parameters: (parameters
(string) @injection.content))
(string
(string_content) @injection.content)))
(#any-of? @_name "match" "not-match" "any-match" "vim-match" "not-vim-match" "any-vim-match")
(#set! injection.language "regex")
(#offset! @injection.content 0 1 0 -1))
(#set! injection.language "regex"))
((predicate
name: (identifier) @_name
parameters: (parameters
(string) @injection.content))
(string
(string_content) @injection.content)))
(#any-of? @_name "lua-match" "not-lua-match" "any-lua-match")
(#set! injection.language "luap")
(#offset! @injection.content 0 1 0 -1))
(#set! injection.language "luap"))
((predicate
name: (identifier) @_name
parameters: (parameters
(string) @injection.content
(string
(string_content) @injection.content)
.
(string) .))
(#any-of? @_name "gsub" "not-gsub")
(#set! injection.language "luap")
(#offset! @injection.content 0 1 0 -1))
(#set! injection.language "luap"))
((comment) @injection.content
(#set! injection.language "comment"))

View File

@ -2,8 +2,6 @@
(braced_expression)
(parenthesized_expression)
(call)
"special"
"|>"
"if"
"else"
"while"

View File

@ -674,12 +674,12 @@
.
(symbol) @keyword.import
(#eq? @keyword.import "require")
(#set! "priority" 101))
(#set! priority 101))
(quote
.
(symbol)
(#set! "priority" 105)) @string.special.symbol
(#set! priority 105)) @string.special.symbol
((sexp_comment) @comment
(#set! "priority" 110))
(#set! priority 110))

View File

@ -0,0 +1,12 @@
[
(block)
(function)
(module_declaration)
(type_declaration)
(external_declaration)
(call_expression)
(switch_expression)
(parenthesized_expression)
(record)
(include_statement)+
] @fold

View File

@ -0,0 +1,335 @@
(comment) @comment @spell
; Identifiers
;------------
; Escaped identifiers like \"+."
((value_identifier) @constant.macro
(#lua-match? @constant.macro "^%.*$"))
(value_identifier) @variable
[
(type_identifier)
(unit_type)
(list)
(list_pattern)
] @type
((type_identifier) @type.builtin
(#any-of? @type.builtin "int" "char" "string" "float" "bool" "unit"))
[
(variant_identifier)
(polyvar_identifier)
] @constructor
(record_type_field
(property_identifier) @property)
(record_field
(property_identifier) @property)
(object
(field
(property_identifier) @property))
(object_type
(field
(property_identifier) @property))
(module_identifier) @module
(member_expression
(property_identifier) @variable.member)
(value_identifier_path
(module_identifier)
(value_identifier) @variable)
(record_pattern
(value_identifier_path
(value_identifier) @variable.member))
(record_pattern
(value_identifier) @variable)
(labeled_argument
label: (value_identifier) @variable.parameter)
; Parameters
;----------------
(list_pattern
(value_identifier) @variable.parameter)
(spread_pattern
(value_identifier) @variable.parameter)
; String literals
;----------------
[
(string)
(template_string)
] @string
(character) @character
(escape_sequence) @string.escape
; Other literals
;---------------
[
(true)
(false)
] @boolean
(number) @number
(polyvar) @constructor
(polyvar_string) @constructor
; Functions
;----------
; parameter(s) in parens
(parameter
(value_identifier) @variable.parameter)
(labeled_parameter
(value_identifier) @variable.parameter)
; single parameter with no parens
(function
parameter: (value_identifier) @variable.parameter)
(parameter
(tuple_pattern
(tuple_item_pattern
(value_identifier) @variable.parameter)))
(parameter
(array_pattern
(value_identifier) @variable.parameter))
(parameter
(record_pattern
(value_identifier) @variable.parameter))
; function identifier in let binding
(let_binding
pattern: (value_identifier) @function
body: (function))
; function calls
(call_expression
function: (value_identifier_path
(value_identifier) @function.method.call .))
(call_expression
function: (value_identifier) @function.call)
; highlight the right-hand side of a pipe operator as a function call
(pipe_expression
(value_identifier) @function.call .)
(pipe_expression
(value_identifier_path
(value_identifier) @function.method.call .) .)
; Meta
;-----
(decorator_identifier) @attribute
(extension_identifier) @keyword
"%" @keyword
; Misc
;-----
(polyvar_type_pattern
"#" @constructor)
[
"include"
"open"
] @keyword.import
[
"private"
"mutable"
"rec"
] @keyword.modifier
"type" @keyword.type
[
"and"
"with"
"as"
] @keyword.operator
[
"export"
"external"
"let"
"module"
"assert"
"await"
"lazy"
"constraint"
] @keyword
"await" @keyword.coroutine
(function
"async" @keyword.coroutine)
(module_unpack
"unpack" @keyword)
[
"if"
"else"
"switch"
"when"
] @keyword.conditional
[
"exception"
"try"
"catch"
] @keyword.exception
(call_expression
function: (value_identifier) @keyword.exception
(#eq? @keyword.exception "raise"))
[
"for"
"in"
"to"
"downto"
"while"
] @keyword.repeat
[
"."
","
"|"
":"
] @punctuation.delimiter
[
"++"
"+"
"+."
"-"
"-."
"*"
"**"
"*."
"/."
"<="
"=="
"==="
"!"
"!="
"!=="
">="
"&&"
"||"
"="
":="
"->"
"|>"
":>"
"+="
"=>"
(uncurry)
] @operator
; Explicitly enclose these operators with binary_expression
; to avoid confusion with JSX tag delimiters
(binary_expression
[
"<"
">"
"/"
] @operator)
[
"("
")"
"{"
"}"
"["
"]"
"<"
">"
] @punctuation.bracket
(unit
[
"("
")"
] @constant.builtin)
(template_substitution
"${" @punctuation.special
"}" @punctuation.special) @none
(polyvar_type
[
"["
"[>"
"[<"
"]"
] @punctuation.bracket)
[
"~"
"?"
".."
"..."
] @punctuation.special
(ternary_expression
[
"?"
":"
] @keyword.conditional.ternary)
; JSX
;----------
(jsx_identifier) @tag
(jsx_element
open_tag: (jsx_opening_element
[
"<"
">"
] @tag.delimiter))
(jsx_element
close_tag: (jsx_closing_element
[
"<"
"/"
">"
] @tag.delimiter))
(jsx_self_closing_element
[
"/"
">"
"<"
] @tag.delimiter)
(jsx_fragment
[
">"
"<"
"/"
] @tag.delimiter)
(jsx_attribute
(property_identifier) @tag.attribute)

View File

@ -0,0 +1,36 @@
[
(block)
(record_type)
(record)
(parenthesized_expression)
(call_expression)
(function_type_parameters)
(function)
(switch_match)
(let_declaration)
(jsx_element)
(jsx_fragment)
(jsx_self_closing_element)
(object_type)
] @indent.begin
[
"}"
")"
(jsx_closing_element)
] @indent.branch @indent.end
(jsx_self_closing_element
"/" @indent.branch
">"? @indent.end)
; </> is captured as 3 different anonymous nodes
(jsx_fragment
"<"
"<" @indent.branch)
(jsx_fragment
">"
">" @indent.end)
(comment) @indent.auto

View File

@ -0,0 +1,33 @@
((comment) @injection.content
(#set! injection.language "comment"))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "re")
(expression_statement
(_) @injection.content
(#set! injection.language "regex")))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "raw")
(expression_statement
(_
(_) @injection.content
(#set! injection.language "javascript"))))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "graphql")
(expression_statement
(_
(_) @injection.content
(#set! injection.language "graphql"))))
(extension_expression
(extension_identifier) @_name
(#eq? @_name "relay")
(expression_statement
(_
(_) @injection.content
(#set! injection.language "graphql"))))

View File

@ -0,0 +1,9 @@
(switch_expression) @local.scope
; Definitions
;------------
(type_declaration) @local.definition.type
(let_binding) @local.definition.var
(module_declaration) @local.definition.namespace

View File

@ -172,10 +172,10 @@
; (#is-not? local))
; Literals
[
(string)
(bare_string)
(subshell)
(heredoc_body)
(string_content)
(heredoc_content)
"\""
"`"
] @string
[
@ -190,11 +190,8 @@
(hash_key_symbol)
] @string.special.symbol
(pair
key: (hash_key_symbol)
":" @constant)
(regex) @string.regexp
(regex
(string_content) @string.regexp)
(escape_sequence) @string.escape
@ -276,8 +273,15 @@
";"
"."
"&."
"::"
] @punctuation.delimiter
(regex
"/" @punctuation.bracket)
(pair
":" @punctuation.delimiter)
[
"("
")"
@ -289,6 +293,9 @@
"%i("
] @punctuation.bracket
(block_parameters
"|" @punctuation.bracket)
(interpolation
"#{" @punctuation.special
"}" @punctuation.special) @none
"}" @punctuation.special)

View File

@ -23,6 +23,8 @@
(field_identifier) @variable.member
(shorthand_field_identifier) @variable.member
(shorthand_field_initializer
(identifier) @variable.member)
@ -382,6 +384,9 @@
"||"
] @operator
(use_wildcard
"*" @character.special)
; Punctuation
[
"("

Some files were not shown because too many files have changed in this diff Show More