From 4ec20eaeffa6144f01ae8d5a95b12ea1593f3080 Mon Sep 17 00:00:00 2001 From: Kirawi Date: Fri, 26 Nov 2021 21:19:40 -0500 Subject: Add language support for WGSL (#1166) --- .gitmodules | 4 ++++ 1 file changed, 4 insertions(+) (limited to '.gitmodules') diff --git a/.gitmodules b/.gitmodules index bf596bdc..039a3ee3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -142,3 +142,7 @@ path = helix-syntax/languages/tree-sitter-perl url = https://github.com/ganezdragon/tree-sitter-perl shallow = true +[submodule "helix-syntax/languages/tree-sitter-wgsl"] + path = helix-syntax/languages/tree-sitter-wgsl + url = https://github.com/szebniok/tree-sitter-wgsl + shallow = true -- cgit v1.2.3-70-g09d2 From 6f1a7b1220c2ae565a2542fb089eb6d87f0a9421 Mon Sep 17 00:00:00 2001 From: Kirawi Date: Sun, 28 Nov 2021 20:38:17 -0500 Subject: Add llvm grammar (#1167) --- .gitmodules | 4 ++++ book/src/themes.md | 5 +++-- languages.toml | 8 ++++++++ runtime/queries/llvm/highlights.scm | 14 ++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 runtime/queries/llvm/highlights.scm (limited to '.gitmodules') diff --git a/.gitmodules b/.gitmodules index 039a3ee3..6295b9e9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -146,3 +146,7 @@ path = helix-syntax/languages/tree-sitter-wgsl url = https://github.com/szebniok/tree-sitter-wgsl shallow = true +[submodule "helix-syntax/tree-sitter-llvm"] + path = helix-syntax/languages/tree-sitter-llvm + url = https://github.com/benwilliamgraham/tree-sitter-llvm + shallow = true diff --git a/book/src/themes.md b/book/src/themes.md index ecbbb6e9..fd3f5b1e 100644 --- a/book/src/themes.md +++ b/book/src/themes.md @@ -145,11 +145,12 @@ We use a similar set of scopes as - `conditional` - `if`, `else` - `repeat` - `for`, `while`, `loop` - `import` - `import`, `export` - - (TODO: return?) + - `return` + - `operator` - `or`, `in` - `directive` - Preprocessor directives (`#if` in C) - `function` - `fn`, `func` -- `operator` - `||`, `+=`, `>`, `or` +- `operator` - `||`, `+=`, `>` - `function` - `builtin` diff --git a/languages.toml b/languages.toml index 5dcbd872..4208e4b6 100644 --- a/languages.toml +++ b/languages.toml @@ -413,3 +413,11 @@ file-types = ["wgsl"] roots = [] comment-token = "//" indent = { tab-width = 4, unit = " " } + +[[language]] +name = "llvm" +scope = "source.llvm" +roots = [] +file-types = ["ll"] +comment-token = ";" +indent = { tab-width = 2, unit = " " } diff --git a/runtime/queries/llvm/highlights.scm b/runtime/queries/llvm/highlights.scm new file mode 100644 index 00000000..73afe85e --- /dev/null +++ b/runtime/queries/llvm/highlights.scm @@ -0,0 +1,14 @@ +(type) @type +(statement) @keyword.operator +(number) @constant.numeric.integer +(comment) @comment +(string) @string +(label) @label +(keyword) @keyword +"ret" @keyword.control.return +(boolean) @constant.builtin.boolean +(float) @constant.numeric.float +(constant) @constant +(identifier) @variable +(symbol) @punctuation.delimiter +(bracket) @punctuation.bracket -- cgit v1.2.3-70-g09d2 From 49e067874133e12d10ad3ac0c941438e2d7025e7 Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Wed, 15 Dec 2021 00:45:38 +0900 Subject: Add markdown grammar Fixes #215 --- .gitmodules | 4 ++++ helix-syntax/languages/tree-sitter-markdown | 1 + languages.toml | 9 ++++++++ runtime/queries/markdown/highlights.scm | 35 +++++++++++++++++++++++++++++ runtime/queries/markdown/injections.scm | 0 runtime/queries/svelte/highlights.scm | 2 +- theme.toml | 6 +++++ 7 files changed, 56 insertions(+), 1 deletion(-) create mode 160000 helix-syntax/languages/tree-sitter-markdown create mode 100644 runtime/queries/markdown/highlights.scm create mode 100644 runtime/queries/markdown/injections.scm (limited to '.gitmodules') diff --git a/.gitmodules b/.gitmodules index 6295b9e9..9c10846d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -150,3 +150,7 @@ path = helix-syntax/languages/tree-sitter-llvm url = https://github.com/benwilliamgraham/tree-sitter-llvm shallow = true +[submodule "helix-syntax/languages/tree-sitter-markdown"] + path = helix-syntax/languages/tree-sitter-markdown + url = https://github.com/MDeiml/tree-sitter-markdown + shallow = true diff --git a/helix-syntax/languages/tree-sitter-markdown b/helix-syntax/languages/tree-sitter-markdown new file mode 160000 index 00000000..ad8c3291 --- /dev/null +++ b/helix-syntax/languages/tree-sitter-markdown @@ -0,0 +1 @@ +Subproject commit ad8c32917a16dfbb387d1da567bf0c3fb6fffde2 diff --git a/languages.toml b/languages.toml index 07b6dba9..abb94acf 100644 --- a/languages.toml +++ b/languages.toml @@ -421,3 +421,12 @@ roots = [] file-types = ["ll"] comment-token = ";" indent = { tab-width = 2, unit = " " } + +[[language]] +name = "markdown" +scope = "source.md" +injection-regex = "md|markdown" +file-types = ["md"] +roots = [] + +indent = { tab-width = 2, unit = " " } diff --git a/runtime/queries/markdown/highlights.scm b/runtime/queries/markdown/highlights.scm new file mode 100644 index 00000000..a102719b --- /dev/null +++ b/runtime/queries/markdown/highlights.scm @@ -0,0 +1,35 @@ +[ + (atx_heading) + (setext_heading) +] @markup.heading + +(code_fence_content) @none + +[ + (indented_code_block) + (fenced_code_block) +] @markup.raw.block + +(code_span) @markup.raw.inline + +(emphasis) @markup.italic + +(strong_emphasis) @markup.bold + +(link_destination) @markup.underline.link + +; (link_label) @markup.label ; TODO: rename + +[ + (list_marker_plus) + (list_marker_minus) + (list_marker_star) + (list_marker_dot) + (list_marker_parenthesis) +] @punctuation.special + +[ + (backslash_escape) + (hard_line_break) +] @string.character.escape + diff --git a/runtime/queries/markdown/injections.scm b/runtime/queries/markdown/injections.scm new file mode 100644 index 00000000..e69de29b diff --git a/runtime/queries/svelte/highlights.scm b/runtime/queries/svelte/highlights.scm index 4fcdfd66..f9eef6b5 100644 --- a/runtime/queries/svelte/highlights.scm +++ b/runtime/queries/svelte/highlights.scm @@ -25,7 +25,7 @@ ((attribute (attribute_name) @_attr - (quoted_attribute_value (attribute_value) @markup.undeline.link)) + (quoted_attribute_value (attribute_value) @markup.underline.link)) (#match? @_attr "^(href|src)$")) (tag_name) @tag diff --git a/theme.toml b/theme.toml index 8c0d1f6c..0a79861e 100644 --- a/theme.toml +++ b/theme.toml @@ -28,6 +28,12 @@ string = "silver" # used for lifetimes label = "honey" +"markup.heading" = "lilac" +"markup.bold" = { modifiers = ["bold"] } +"markup.italic" = { modifiers = ["italic"] } +"markup.underline.link" = { fg = "silver", modifiers = ["underlined"] } +"markup.raw" = "almond" + # TODO: diferentiate doc comment # concat (ERROR) @error.syntax and "MISSING ;" selectors for errors -- cgit v1.2.3-70-g09d2