Unnamed repository; edit this file 'description' to name the repository.
| -rw-r--r-- | book/src/generated/lang-support.md | 1 | ||||
| -rw-r--r-- | languages.toml | 14 | ||||
| -rw-r--r-- | runtime/queries/wikitext/folds.scm | 2 | ||||
| -rw-r--r-- | runtime/queries/wikitext/highlights.scm | 92 |
4 files changed, 109 insertions, 0 deletions
diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 86cc7890..aefc729d 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -288,6 +288,7 @@ | werk | ✓ | | | | | | | wesl | ✓ | ✓ | | | | | | wgsl | ✓ | ✓ | ✓ | ✓ | ✓ | `wgsl-analyzer` | +| wikitext | ✓ | | | | | `wikitext-lsp` | | wit | ✓ | | ✓ | | | | | wren | ✓ | ✓ | ✓ | | | | | xit | ✓ | | | | | | diff --git a/languages.toml b/languages.toml index 70d31cc1..33b1c937 100644 --- a/languages.toml +++ b/languages.toml @@ -142,6 +142,7 @@ vscode-html-language-server = { command = "vscode-html-language-server", args = vscode-json-language-server = { command = "vscode-json-language-server", args = ["--stdio"], config = { provideFormatter = true, json = { validate = { enable = true } } } } vuels = { command = "vue-language-server", args = ["--stdio"], config = { typescript = { tsdk = "node_modules/typescript/lib/" } } } wgsl-analyzer = { command = "wgsl-analyzer" } +wikitext-lsp = { command = "wikitext-lsp", args = ["--stdio"]} yaml-language-server = { command = "yaml-language-server", args = ["--stdio"] } yls = { command = "yls", args = ["-vv"] } zls = { command = "zls" } @@ -4802,3 +4803,16 @@ grammar = "yaml" indent = { tab-width = 2, unit = " " } language-servers = ["yaml-language-server", "gitlab-ci-ls"] comment-token = "#" + +[[grammar]] +name = "wikitext" +source = { git = "https://github.com/santhoshtr/tree-sitter-wikitext", rev = "444214b31695e9dd4d32fb06247397fb8778a9d2"} + +[[language]] +name = "wikitext" +scope = "source.wikitext" +file-types = ["wikimedia", "mediawiki", "wikitext"] +language-servers = ["wikitext-lsp"] +indent = { tab-width = 2, unit = " " } +block-comment-tokens = { start = "<!--", end = "-->" } +word-completion.trigger-length = 4 diff --git a/runtime/queries/wikitext/folds.scm b/runtime/queries/wikitext/folds.scm new file mode 100644 index 00000000..baefe749 --- /dev/null +++ b/runtime/queries/wikitext/folds.scm @@ -0,0 +1,2 @@ +(section) @fold + diff --git a/runtime/queries/wikitext/highlights.scm b/runtime/queries/wikitext/highlights.scm new file mode 100644 index 00000000..a3545ca8 --- /dev/null +++ b/runtime/queries/wikitext/highlights.scm @@ -0,0 +1,92 @@ +(heading1 + (heading_marker) @markup.heading.marker + (text) @markup.heading.1 + (heading_marker) @markup.heading.marker +) +(heading2 + (heading_marker) @markup.heading.marker + (text) @markup.heading.2 + (heading_marker) @markup.heading.marker +) +(heading3 + (heading_marker) @markup.heading.marker + (text) @markup.heading.3 + (heading_marker) @markup.heading.marker +) +(heading4 + (heading_marker) @markup.heading.marker + (text) @markup.heading.4 + (heading_marker) @markup.heading.marker +) +(heading5 + (heading_marker) @markup.heading.marker + (text) @markup.heading.5 + (heading_marker) @markup.heading.marker +) +(heading6 + (heading_marker) @markup.heading.marker + (text) @markup.heading.6 + (heading_marker) @markup.heading.marker +) + +(wikilink + (wikilink_page) @markup.link.url + (page_name_segment)? @markup.link.label +) +(external_link + (url) @markup.link.url + (page_name_segment)? @markup.link.label +) + +(template + (template_name) @function + (template_argument + (template_param_name)? @attribute + (template_param_value)? @string + ) +) + +(comment) @comment + +[ + "[[" + "]]" + "{{" + "}}" + "{|" + "|}" + "[" + "]" + "<" + ">" + "</" +] @punctuation.bracket + +[ + "|" + "|-" + "|+" + "!" + "!!" + "||" +] @punctuation.delimiter + +(table_header_block + (content) @markup.bold +) +(table_header_inline + (content) @markup.bold +) + +(html_tag_name) @tag +(html_attribute + (html_attribute_name) @attribute +) +(html_attribute + (html_attribute_name) @attribute + (html_attribute_value) @string +) + +(italic) @markup.italic +(bold) @markup.bold + |