Skip to content

Commit

Permalink
feat: Add ADL language support
Browse files Browse the repository at this point in the history
  • Loading branch information
millergarym committed Mar 28, 2024
1 parent f21efc7 commit 50bc4a6
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 0 deletions.
1 change: 1 addition & 0 deletions book/src/generated/lang-support.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
| Language | Syntax Highlighting | Treesitter Textobjects | Auto Indent | Default LSP |
| --- | --- | --- | --- | --- |
| ada ||| | `ada_language_server`, `ada_language_server` |
| adl |||| |
| agda || | | |
| astro || | | |
| awk ||| | `awk-language-server` |
Expand Down
18 changes: 18 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3430,3 +3430,21 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "ohm"
source = { git = "https://github.com/novusnota/tree-sitter-ohm", rev = "80f14f0e477ddacc1e137d5ed8e830329e3fb7a3" }

[[language]]
name = "adl"
scope = "source.adl"
injection-regex = "adl"
file-types = ["adl"]
roots = []
comment-token = "//"
indent = { tab-width = 2, unit = " " }

[language.auto-pairs]
'"' = '"'
'{' = '}'
'<' = '>'

[[grammar]]
name = "adl"
source = { git = "https://github.com/adl-lang/tree-sitter-adl", rev = "0399ed80b9fb88865a02259e7c11dc98de1d5ee5" }
39 changes: 39 additions & 0 deletions runtime/queries/adl/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
; adl

[
"module"
"struct"
"union"
"type"
"newtype"
"annotation"
] @keyword

(scoped_name) @variable
(comment) @comment
(doc_comment) @info
(name) @type

(ERROR) @error

(fname) @property

(type_expr (scoped_name) @type)

(type_expr (scoped_name) @generic (type_param) @type.param)

; json
(key) @string.special.key

(string) @string

(number) @number

[
(null)
(true)
(false)
] @constant.builtin

(escape_sequence) @escape

12 changes: 12 additions & 0 deletions runtime/queries/adl/indents.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
(struct)
(union)

(array)
(object)
] @indent

; [
; "}"
; "]"
; ] @outdent
1 change: 1 addition & 0 deletions runtime/queries/adl/textobjects.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(struct (_) @function.inside) @funtion.around

0 comments on commit 50bc4a6

Please sign in to comment.