Skip to content

Commit

Permalink
feat(languages): Support markdoc (#6432)
Browse files Browse the repository at this point in the history
  • Loading branch information
matoous authored Apr 12, 2023
1 parent fed5e6e commit 70de502
Show file tree
Hide file tree
Showing 4 changed files with 30 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
Expand Up @@ -81,6 +81,7 @@
| llvm-mir-yaml || || |
| lua |||| `lua-language-server` |
| make || | | |
| markdoc || | | `markdoc-ls` |
| markdown || | | `marksman` |
| markdown.inline || | | |
| matlab || | | |
Expand Down
11 changes: 11 additions & 0 deletions languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2461,3 +2461,14 @@ indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "hurl"
source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c42064b61ee21abe88d0061f29a0523352e22" }

[[language]]
name = "markdoc"
scope = "text.markdoc"
roots = []
file-types = ["mdoc"]
language-server = { command = "markdoc-ls", args = ["--stdio"] }

[[grammar]]
name = "markdoc"
source = { git = "https://github.com/markdoc-extra/tree-sitter-markdoc", rev = "5ffe71b29e8a3f94823913ea9cea51fcfa7e3bf8" }
16 changes: 16 additions & 0 deletions runtime/queries/markdoc/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
tag_name: (identifier) @tag
(tag_self_closing "/" @tag)
(tag_close "/" @tag)
([(tag_start) (tag_end) "="] @tag)
(attribute [key : (identifier)] @attribute)
(attribute [shorthand : (identifier)] @attribute)
(variable [variable : (identifier) (variable_sigil)] @variable)
(variable_tail property : (identifier) @variable.other.member)
(function function_name : (identifier) @function)
(function_parameter_named parameter : (identifier) @variable.parameter)

(hash_key key: (identifier) @variable.other.member)
(string) @string
(number) @constant.numeric
(boolean) @constant.builtin.boolean
(null) @constant.builtin
2 changes: 2 additions & 0 deletions runtime/queries/markdoc/injections.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
((markdown) @injection.content
(#set! injection.language "markdown"))

0 comments on commit 70de502

Please sign in to comment.