on master help sign in
add tree-sitter-edoc (#2640)
42d780bMichael Davis
book/src/generated/lang-support.md+1
@@ -12,6 +12,7 @@
12| dart | ✓ | | ✓ | `dart` |
12| dart | ✓ | | ✓ | `dart` |
13| devicetree | ✓ | | ✓ | |
13| devicetree | ✓ | | ✓ | |
14| dockerfile | ✓ | | | `docker-langserver` |
14| dockerfile | ✓ | | | `docker-langserver` |
15+| edoc | ✓ | | | |
15| eex | ✓ | | | |
16| eex | ✓ | | | |
16| ejs | ✓ | | | |
17| ejs | ✓ | | | |
17| elixir | ✓ | | | `elixir-ls` |
18| elixir | ✓ | | | `elixir-ls` |
languages.toml+13−1
@@ -1049,7 +1049,7 @@ language-server = { command = "erlang_ls" }
1049
1049
1050[[grammar]]
1050[[grammar]]
1051name = "erlang"
1051name = "erlang"
1052−source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "6cd8f956ada445b277de1581b5328ae8e8be9aac" }
1052+source = { git = "https://github.com/the-mikedavis/tree-sitter-erlang", rev = "481e7f8ddf27f07a47d1531b6e2b154b89ece31d" }
1053
1053
1054[[language]]
1054[[language]]
1055name = "kotlin"
1055name = "kotlin"
@@ -1409,3 +1409,15 @@ injection-regex = "verilog"
1409[[grammar]]
1409[[grammar]]
1410name = "verilog"
1410name = "verilog"
1411source = { git = "https://github.com/andreytkachenko/tree-sitter-verilog", rev = "514d8d70593d29ef3ef667fa6b0e504ae7c977e3" }
1411source = { git = "https://github.com/andreytkachenko/tree-sitter-verilog", rev = "514d8d70593d29ef3ef667fa6b0e504ae7c977e3" }
1412+
1413+[[language]]
1414+name = "edoc"
1415+scope = "source.edoc"
1416+file-types = ["edoc", "edoc.in"]
1417+injection-regex = "edoc"
1418+roots = []
1419+indent = { tab-width = 4, unit = " " }
1420+
1421+[[grammar]]
1422+name = "edoc"
1423+source = { git = "https://github.com/the-mikedavis/tree-sitter-edoc", rev = "1691ec0aa7ad1ed9fa295590545f27e570d12d60" }
runtime/queries/edoc/highlights.scmnew file+50
@@ -0,0 +1,50 @@
1+((section
2+ (section_marker) @markup.heading.marker
3+ (section_content) @markup.heading.1
4+ (section_marker) @markup.heading.marker)
5+ (#eq? @markup.heading.marker "=="))
6+
7+((section
8+ (section_marker) @markup.heading.marker
9+ (section_content) @markup.heading.2
10+ (section_marker) @markup.heading.marker)
11+ (#eq? @markup.heading.marker "==="))
12+
13+((section
14+ (section_marker) @markup.heading.marker
15+ (section_content) @markup.heading.3
16+ (section_marker) @markup.heading.marker)
17+ (#eq? @markup.heading.marker "===="))
18+
19+(macro (tag) @function.macro)
20+(tag) @keyword
21+(macro_escape) @constant.character.escape
22+(inline_quote) @markup.raw.inline
23+(email_address) @markup.link.url
24+
25+(em_xhtml_tag
26+ (open_xhtml_tag) @tag
27+ (xhtml_tag_content) @markup.italic
28+ (close_xhtml_tag) @tag)
29+
30+(strong_xhtml_tag
31+ (open_xhtml_tag) @tag
32+ (xhtml_tag_content) @markup.bold
33+ (close_xhtml_tag) @tag)
34+
35+(module) @namespace
36+(function) @function
37+(type) @type
38+
39+; could be @constant.numeric.integer but this looks similar to a capture
40+(arity) @operator
41+
42+[":" "/"] @operator
43+["(" ")"] @punctuation.delimiter
44+["{" "}"] @function.macro
45+
46+[
47+ (quote_marker)
48+ (language_identifier)
49+ (quote_content)
50+] @markup.raw.block
runtime/queries/edoc/injections.scmnew file+20
@@ -0,0 +1,20 @@
1+((xhtml_tag) @injection.content
2+ (#set! injection.combined)
3+ (#set! injection.include-children)
4+ (#set! injection.language "html"))
5+
6+((block_quote
7+ !language
8+ (quote_content) @injection.content)
9+ (#set! injection.language "erlang"))
10+
11+(block_quote
12+ language: (language_identifier) @injection.language
13+ (quote_content) @injection.content)
14+
15+((macro
16+ (tag) @_tag
17+ (argument) @injection.content)
18+ (#eq? @_tag "@type")
19+ (#set injection.language "erlang")
20+ (#set injection.include-children))
runtime/queries/erlang/injections.scm+2−2
@@ -1,2 +1,2 @@
1−((comment) @injection.content
1+((comment_content) @injection.content
2− (#set! injection.language "comment"))
2+ (#set! injection.language "edoc"))
runtime/queries/markdown/highlights.scm+1−1
@@ -45,5 +45,5 @@
45[
45[
46 (backslash_escape)
46 (backslash_escape)
47 (hard_line_break)
47 (hard_line_break)
48−] @string.character.escape
48+] @constant.character.escape
49
49
runtime/queries/tsq/highlights.scm+1
@@ -16,6 +16,7 @@
16] @punctuation.bracket
16] @punctuation.bracket
17
17
18":" @punctuation.delimiter
18":" @punctuation.delimiter
19+"!" @operator
19
20
20[
21[
21 (one_or_more)
22 (one_or_more)