Skip to content

Commit 1388166

Browse files
authored
feat: add support for grammar wikitext the mediawiki dialect (#14432)
1 parent 342f2a9 commit 1388166

File tree

4 files changed

+109
-0
lines changed

4 files changed

+109
-0
lines changed

book/src/generated/lang-support.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@
288288
| werk || | | | | |
289289
| wesl ||| | | | |
290290
| wgsl |||||| `wgsl-analyzer` |
291+
| wikitext || | | | | `wikitext-lsp` |
291292
| wit || || | | |
292293
| wren |||| | | |
293294
| xit || | | | | |

languages.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ vscode-html-language-server = { command = "vscode-html-language-server", args =
142142
vscode-json-language-server = { command = "vscode-json-language-server", args = ["--stdio"], config = { provideFormatter = true, json = { validate = { enable = true } } } }
143143
vuels = { command = "vue-language-server", args = ["--stdio"], config = { typescript = { tsdk = "node_modules/typescript/lib/" } } }
144144
wgsl-analyzer = { command = "wgsl-analyzer" }
145+
wikitext-lsp = { command = "wikitext-lsp", args = ["--stdio"]}
145146
yaml-language-server = { command = "yaml-language-server", args = ["--stdio"] }
146147
yls = { command = "yls", args = ["-vv"] }
147148
zls = { command = "zls" }
@@ -4802,3 +4803,16 @@ grammar = "yaml"
48024803
indent = { tab-width = 2, unit = " " }
48034804
language-servers = ["yaml-language-server", "gitlab-ci-ls"]
48044805
comment-token = "#"
4806+
4807+
[[grammar]]
4808+
name = "wikitext"
4809+
source = { git = "https://github.com/santhoshtr/tree-sitter-wikitext", rev = "444214b31695e9dd4d32fb06247397fb8778a9d2"}
4810+
4811+
[[language]]
4812+
name = "wikitext"
4813+
scope = "source.wikitext"
4814+
file-types = ["wikimedia", "mediawiki", "wikitext"]
4815+
language-servers = ["wikitext-lsp"]
4816+
indent = { tab-width = 2, unit = " " }
4817+
block-comment-tokens = { start = "<!--", end = "-->" }
4818+
word-completion.trigger-length = 4

runtime/queries/wikitext/folds.scm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(section) @fold
2+
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
(heading1
2+
(heading_marker) @markup.heading.marker
3+
(text) @markup.heading.1
4+
(heading_marker) @markup.heading.marker
5+
)
6+
(heading2
7+
(heading_marker) @markup.heading.marker
8+
(text) @markup.heading.2
9+
(heading_marker) @markup.heading.marker
10+
)
11+
(heading3
12+
(heading_marker) @markup.heading.marker
13+
(text) @markup.heading.3
14+
(heading_marker) @markup.heading.marker
15+
)
16+
(heading4
17+
(heading_marker) @markup.heading.marker
18+
(text) @markup.heading.4
19+
(heading_marker) @markup.heading.marker
20+
)
21+
(heading5
22+
(heading_marker) @markup.heading.marker
23+
(text) @markup.heading.5
24+
(heading_marker) @markup.heading.marker
25+
)
26+
(heading6
27+
(heading_marker) @markup.heading.marker
28+
(text) @markup.heading.6
29+
(heading_marker) @markup.heading.marker
30+
)
31+
32+
(wikilink
33+
(wikilink_page) @markup.link.url
34+
(page_name_segment)? @markup.link.label
35+
)
36+
(external_link
37+
(url) @markup.link.url
38+
(page_name_segment)? @markup.link.label
39+
)
40+
41+
(template
42+
(template_name) @function
43+
(template_argument
44+
(template_param_name)? @attribute
45+
(template_param_value)? @string
46+
)
47+
)
48+
49+
(comment) @comment
50+
51+
[
52+
"[["
53+
"]]"
54+
"{{"
55+
"}}"
56+
"{|"
57+
"|}"
58+
"["
59+
"]"
60+
"<"
61+
">"
62+
"</"
63+
] @punctuation.bracket
64+
65+
[
66+
"|"
67+
"|-"
68+
"|+"
69+
"!"
70+
"!!"
71+
"||"
72+
] @punctuation.delimiter
73+
74+
(table_header_block
75+
(content) @markup.bold
76+
)
77+
(table_header_inline
78+
(content) @markup.bold
79+
)
80+
81+
(html_tag_name) @tag
82+
(html_attribute
83+
(html_attribute_name) @attribute
84+
)
85+
(html_attribute
86+
(html_attribute_name) @attribute
87+
(html_attribute_value) @string
88+
)
89+
90+
(italic) @markup.italic
91+
(bold) @markup.bold
92+

0 commit comments

Comments
 (0)