on master help sign in
feat(languages): Support markdoc (#6432)
70de502Matouš Dzivjak
book/src/generated/lang-support.md+1
@@ -81,6 +81,7 @@
81| llvm-mir-yaml | ✓ | | ✓ | |
81| llvm-mir-yaml | ✓ | | ✓ | |
82| lua | ✓ | ✓ | ✓ | `lua-language-server` |
82| lua | ✓ | ✓ | ✓ | `lua-language-server` |
83| make | ✓ | | | |
83| make | ✓ | | | |
84+| markdoc | ✓ | | | `markdoc-ls` |
84| markdown | ✓ | | | `marksman` |
85| markdown | ✓ | | | `marksman` |
85| markdown.inline | ✓ | | | |
86| markdown.inline | ✓ | | | |
86| matlab | ✓ | | | |
87| matlab | ✓ | | | |
languages.toml+11
@@ -2461,3 +2461,14 @@ indent = { tab-width = 2, unit = " " }
2461[[grammar]]
2461[[grammar]]
2462name = "hurl"
2462name = "hurl"
2463source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c42064b61ee21abe88d0061f29a0523352e22" }
2463source = { git = "https://github.com/pfeiferj/tree-sitter-hurl", rev = "264c42064b61ee21abe88d0061f29a0523352e22" }
2464+
2465+[[language]]
2466+name = "markdoc"
2467+scope = "text.markdoc"
2468+roots = []
2469+file-types = ["mdoc"]
2470+language-server = { command = "markdoc-ls", args = ["--stdio"] }
2471+
2472+[[grammar]]
2473+name = "markdoc"
2474+source = { git = "https://github.com/markdoc-extra/tree-sitter-markdoc", rev = "5ffe71b29e8a3f94823913ea9cea51fcfa7e3bf8" }
runtime/queries/markdoc/highlights.scmnew file+16
@@ -0,0 +1,16 @@
1+tag_name: (identifier) @tag
2+(tag_self_closing "/" @tag)
3+(tag_close "/" @tag)
4+([(tag_start) (tag_end) "="] @tag)
5+(attribute [key : (identifier)] @attribute)
6+(attribute [shorthand : (identifier)] @attribute)
7+(variable [variable : (identifier) (variable_sigil)] @variable)
8+(variable_tail property : (identifier) @variable.other.member)
9+(function function_name : (identifier) @function)
10+(function_parameter_named parameter : (identifier) @variable.parameter)
11+
12+(hash_key key: (identifier) @variable.other.member)
13+(string) @string
14+(number) @constant.numeric
15+(boolean) @constant.builtin.boolean
16+(null) @constant.builtin
runtime/queries/markdoc/injections.scmnew file+2
@@ -0,0 +1,2 @@
1+((markdown) @injection.content
2+ (#set! injection.language "markdown"))