feat(languages): Support markdoc (#6432)

Add basic support for [markdoc](https://markdoc.dev/).

For language server, see: https://github.com/markdoc-extra/markdoc-ls
For tree sitter, see: https://github.com/markdoc-extra/tree-sitter-markdoc
This commit is contained in:
Matouš Dzivjak 2023-04-12 17:28:03 +02:00 committed by GitHub
parent fed5e6e646
commit 70de5026b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 0 deletions

View File

@ -81,6 +81,7 @@
| llvm-mir-yaml | ✓ | | ✓ | |
| lua | ✓ | ✓ | ✓ | `lua-language-server` |
| make | ✓ | | | |
| markdoc | ✓ | | | `markdoc-ls` |
| markdown | ✓ | | | `marksman` |
| markdown.inline | ✓ | | | |
| matlab | ✓ | | | |

View File

@ -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" }

View File

@ -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

View File

@ -0,0 +1,2 @@
((markdown) @injection.content
(#set! injection.language "markdown"))