From 239de88fbbc45d2caed55150b4bd688b513da017 Mon Sep 17 00:00:00 2001 From: iko Date: Sat, 30 Dec 2023 15:48:46 +0300 Subject: [PATCH 1/4] Added Hoon --- languages.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/languages.toml b/languages.toml index b47fb4e2b849..63bb2e4c0da3 100644 --- a/languages.toml +++ b/languages.toml @@ -3006,3 +3006,15 @@ file-types = ["janet"] comment-token = "#" indent = { tab-width = 2, unit = " " } grammar = "clojure" + +[[language]] +name = "hoon" +scope = "source.hoon" +injection-regex = "hoon" +file-types = ["hoon"] +comment-token = "::" +indent = {tab-width = 2, unit = " "} + +[[grammar]] +name = "hoon" +source = { git = "https://github.com/urbit-pilled/tree-sitter-hoon", rev = "1d5df35af3e0afe592832a67b9fb3feeeba1f7b6" } From ad0f279aaf8409d952115d3441a5986ccbe2bdfb Mon Sep 17 00:00:00 2001 From: iko Date: Wed, 3 Jan 2024 16:05:57 +0300 Subject: [PATCH 2/4] Added highlights.scm --- runtime/queries/hoon/highlights.scm | 32 +++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 runtime/queries/hoon/highlights.scm diff --git a/runtime/queries/hoon/highlights.scm b/runtime/queries/hoon/highlights.scm new file mode 100644 index 000000000000..387117a9558a --- /dev/null +++ b/runtime/queries/hoon/highlights.scm @@ -0,0 +1,32 @@ +(number) @number + +(string) @string + +[ + "(" + ")" + "[" + "]" +] @punctuation.bracket + +[ + (coreTerminator) + (seriesTerminator) +] @punctuation.delimiter + + +(rune) @keyword + +(term) @constant + +(aura) @constant.builtin + +(Gap) @comment + +(boolean) @constant.builtin + +(date) @constant.builtin +(mold) @constant.builtin +(specialIndex) @constant.builtin +(lark) @operator +(fullContext) @constant.builtin From 2f82f1597e8585e1a38f70ba0b1ca7d739d498a6 Mon Sep 17 00:00:00 2001 From: iko Date: Wed, 3 Jan 2024 17:57:17 +0300 Subject: [PATCH 3/4] Updated docs --- book/src/generated/lang-support.md | 1 + 1 file changed, 1 insertion(+) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 0c5b35cc6f08..8f1364eb865f 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -68,6 +68,7 @@ | haskell-persistent | ✓ | | | | | hcl | ✓ | | ✓ | `terraform-ls` | | heex | ✓ | ✓ | | `elixir-ls` | +| hoon | ✓ | | | | | hosts | ✓ | | | | | html | ✓ | | | `vscode-html-language-server` | | hurl | ✓ | | ✓ | | From c6e66b6b69568472ca06e0ab447b7a0df6fd8bad Mon Sep 17 00:00:00 2001 From: iko Date: Wed, 3 Jan 2024 21:45:23 +0300 Subject: [PATCH 4/4] Update runtime/queries/hoon/highlights.scm Co-authored-by: Michael Davis --- runtime/queries/hoon/highlights.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/queries/hoon/highlights.scm b/runtime/queries/hoon/highlights.scm index 387117a9558a..91e6b8542800 100644 --- a/runtime/queries/hoon/highlights.scm +++ b/runtime/queries/hoon/highlights.scm @@ -1,4 +1,4 @@ -(number) @number +(number) @constant.numeric (string) @string