diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 81aac6a6cc43..c677b1d9b0b9 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -103,6 +103,7 @@ | idris | | | | `idris2-lsp` | | iex | ✓ | | | | | ini | ✓ | | | | +| ink | ✓ | | | | | inko | ✓ | ✓ | ✓ | | | janet | ✓ | | | | | java | ✓ | ✓ | ✓ | `jdtls` | diff --git a/languages.toml b/languages.toml index 8eabe75def80..ecf23a9ac76c 100644 --- a/languages.toml +++ b/languages.toml @@ -4174,3 +4174,17 @@ language-servers = [ "yls" ] [[grammar]] name = "yara" source = { git = "https://github.com/egibs/tree-sitter-yara", rev = "eb3ede203275c38000177f72ec0f9965312806ef" } + +[[language]] +name = "ink" +scope = "source.ink" +file-types = ["ink"] +injection-regex = "ink" +comment-token = "//" +block-comment-tokens = { start = "/*", end = "*/"} +indent = { tab-width = 4, unit = "\t" } +soft-wrap = { enable = true } + +[[grammar]] +name = "ink" +source = { git = "https://github.com/rhizoome/tree-sitter-ink", rev = "8486e9b1627b0bc6b2deb9ee8102277a7c1281ac" } diff --git a/runtime/queries/ink/highlights.scm b/runtime/queries/ink/highlights.scm new file mode 100644 index 000000000000..771721a1d0c9 --- /dev/null +++ b/runtime/queries/ink/highlights.scm @@ -0,0 +1,53 @@ +; tags and labels +(label) @label +(tag (identifier) @commment) +(tag) @comment + +; values +(identifier) @function +(string) @string +(boolean) @constant +(number) @constant.numeric + +; headers +(knot_header) @keyword +(stitch_header) @keyword +(function_header) @keyword + +; marks (ink) +(option_mark) @keyword.directive +(gather_mark) @type.builtin +(glue) @type.builtin + +; calls +(divert_or_thread) @function + +; operators +(assignment) @operator + +; special marks/operators (ink) +(arrow) @special +(double_arrow) @special +(back_arrow) @constant +(dot) @special +(mark_start) @special +(mark_end) @special +(hide_start) @special +(hide_end) @special + +; declarations +(var_line) @attribute +(const_line) @constant +(list_line) @type + +; comments +(line_comment) @comment +(block_comment) @comment + +; unparsed code +(inline_block) @keyword +(condition_block) @keyword +(code_text) @keyword + +; support injection +(program) @ui.text