diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index cd937ca2b..360e1a625 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -3,6 +3,7 @@ | ada | ✓ | ✓ | | `ada_language_server` | | adl | ✓ | ✓ | ✓ | | | agda | ✓ | | | | +| alloy | ✓ | | | | | amber | ✓ | | | | | astro | ✓ | | | `astro-ls` | | awk | ✓ | ✓ | | `awk-language-server` | diff --git a/languages.toml b/languages.toml index ce71ee069..b436baa58 100644 --- a/languages.toml +++ b/languages.toml @@ -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" } diff --git a/runtime/queries/alloy/highlights.scm b/runtime/queries/alloy/highlights.scm new file mode 100644 index 000000000..e62970c6b --- /dev/null +++ b/runtime/queries/alloy/highlights.scm @@ -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)