syntax: add grammar and highlighting for the alloy config lang (#13660)

pull/13648/head
Matt Conway 2025-06-06 11:02:30 -04:00 committed by GitHub
parent 8d2870b94a
commit d375f1e7f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 52 additions and 0 deletions

View File

@ -3,6 +3,7 @@
| ada | ✓ | ✓ | | `ada_language_server` |
| adl | ✓ | ✓ | ✓ | |
| agda | ✓ | | | |
| alloy | ✓ | | | |
| amber | ✓ | | | |
| astro | ✓ | | | `astro-ls` |
| awk | ✓ | ✓ | | `awk-language-server` |

View File

@ -4390,3 +4390,15 @@ language-servers = [ "clarinet" ]
name = "clarity"
source = { git = "https://github.com/xlittlerag/tree-sitter-clarity", rev = "7fa54825fdd971a1a676f885384f024fe2b7384a" }
[[language]]
name = "alloy"
scope = "source.alloy"
injection-regex = "alloy"
file-types = ["alloy"]
comment-token = "//"
block-comment-tokens = { start = "/*", end = "*/" }
indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "alloy"
source = { git = "https://github.com/mattsre/tree-sitter-alloy", rev = "3e18eb4e97f06c57a3925f3d20bef6329a6eaef3" }

View File

@ -0,0 +1,39 @@
; Literals
; --------
(boolean) @constant.builtin.boolean
(comment) @comment
(string) @string
(number) @constant.numeric
(null) @constant.builtin
; Punctuation
; -----------
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
[
"."
","
] @punctuation.delimiter
[
"="
] @operator
; Function definitions
;---------------------
(function
name: (identifier) @function)
(attribute (identifier) @variable.other.member)
(block (identifier) @type.builtin)