on master help sign in
Language support for dhall

https://dhall-lang.org/

commit1f6809c9ce8f4b864b3754111b8673ca282f67f5 authorClément Delafargue <clement@delafargue.name> dateFri 13 Jan 2023, 11:29 (4 years ago) parent051cd78
4 files changed+91
book/src/generated/lang-support.md+1 languages.toml+15 runtime/queries/dhall/highlights.scm+52 runtime/queries/dhall/textobjects.scm+23
book/src/generated/lang-support.md+1
@@ -22,6 +22,7 @@
2222| d | ✓ | ✓ | ✓ | `serve-d` |
2323| dart | ✓ | | ✓ | `dart` |
2424| devicetree | ✓ | | | |
25+| dhall | ✓ | ✓ | | `dhall-lsp-server` |
2526| diff | ✓ | | | |
2627| dockerfile | ✓ | | | `docker-langserver` |
2728| dot | ✓ | | | `dot-language-server` |
languages.toml+15
@@ -2092,3 +2092,18 @@ comment-token = "//"
20922092[[grammar]]
20932093name = "ponylang"
20942094source = { git = "https://github.com/mfelsche/tree-sitter-ponylang", rev = "ef66b151bc2604f431b5668fcec4747db4290e11" }
2095+
2096+[[language]]
2097+name = "dhall"
2098+scope = "source.dhall"
2099+injection-regex = "dhall"
2100+file-types = ["dhall"]
2101+roots = []
2102+comment-token = "--"
2103+indent = { tab-width = 2, unit = " " }
2104+language-server = { command = "dhall-lsp-server" }
2105+formatter = { command = "dhall" , args = ["format"] }
2106+
2107+[[grammar]]
2108+name = "dhall"
2109+source = { git = "https://github.com/jbellerb/tree-sitter-dhall", rev = "affb6ee38d629c9296749767ab832d69bb0d9ea8" }
runtime/queries/dhall/highlights.scmnew file+52
@@ -0,0 +1,52 @@
1+;; Literals
2+
3+(integer_literal) @constant.numeric.integer
4+(natural_literal) @constant.numeric.integer
5+(double_literal) @constant.numeric.float
6+(boolean_literal) @constant.builtin.boolean
7+(text_literal) @string
8+(local_import) @string.special.path
9+(http_import) @string.special.url
10+(import_hash) @string
11+
12+;; Comments
13+[
14+ (line_comment)
15+ (block_comment)
16+] @comment
17+
18+;; Keywords
19+[
20+ ("let")
21+ ("in")
22+ (assign_operator)
23+ (type_operator)
24+ (lambda_operator)
25+ (arrow_operator)
26+ (infix_operator)
27+ (completion_operator)
28+ ("using")
29+ ("assert")
30+ (assert_operator)
31+ ("as")
32+ (forall_operator)
33+ ("with")
34+] @keyword
35+
36+;; Builtins
37+[
38+ (builtin_function)
39+ (missing_import)
40+] @function.builtin
41+
42+[
43+ (builtin)
44+ (import_as_text)
45+] @type.builtin
46+
47+;; Conditionals
48+[
49+ ("if")
50+ ("then")
51+ ("else")
52+] @keyword.control.conditional
runtime/queries/dhall/textobjects.scmnew file+23
@@ -0,0 +1,23 @@
1+(lambda_expression
2+ (label) @parameter.inside
3+ (expression) @function.inside
4+) @function.around
5+
6+(forall_expression
7+ (label) @parameter.inside
8+ (expression) @function.inside
9+) @function.around
10+
11+(assert_expression
12+ (expression) @test.inside
13+) @test.around
14+
15+[
16+ (block_comment_content)
17+ (line_comment_content)
18+] @comment.inside
19+
20+[
21+ (block_comment)
22+ (line_comment)
23+] @comment.around