From e72786df8eae5684c0330be18f190a33f516da76 Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 19 Dec 2021 08:56:56 -0600 Subject: Add tree-sitter-comment (#1300) * Add tree-sitter-comment Fix #1164 * fix precedence in tree-sitter-comment highlights connects https://github.com/helix-editor/helix/pull/1170 * set injection-regex for comment language * remove comment filetype * fix comment injections for neovim-style injections tags * add comment injections for elixir * remove f.comment * fix spacing in .gitmodules * run 'cargo xtask docgen' Co-authored-by: Ivan Tham --- runtime/queries/glsl/injections.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/queries/glsl') diff --git a/runtime/queries/glsl/injections.scm b/runtime/queries/glsl/injections.scm index 7d3323b1..b01b8b4b 100644 --- a/runtime/queries/glsl/injections.scm +++ b/runtime/queries/glsl/injections.scm @@ -1,3 +1,5 @@ -(preproc_arg) @glsl +((preproc_arg) @injection.content + (#set! injection.language "glsl")) -(comment) @comment +((comment) @injection.content + (#set! injection.language "comment")) -- cgit v1.2.3-70-g09d2 From 23091c9d29f575379d01b7011890da044a302433 Mon Sep 17 00:00:00 2001 From: Sebastian Neubauer Date: Mon, 20 Dec 2021 03:42:23 +0100 Subject: Highlight comments in c, cpp, cmake and llvm (#1309) Also, reuse the c injections in glsl--- runtime/queries/c/injections.scm | 2 ++ runtime/queries/cmake/injections.scm | 4 ++++ runtime/queries/cpp/injections.scm | 1 + runtime/queries/glsl/injections.scm | 5 ++--- runtime/queries/llvm/injections.scm | 2 ++ 5 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 runtime/queries/c/injections.scm create mode 100644 runtime/queries/cmake/injections.scm create mode 100644 runtime/queries/cpp/injections.scm create mode 100644 runtime/queries/llvm/injections.scm (limited to 'runtime/queries/glsl') diff --git a/runtime/queries/c/injections.scm b/runtime/queries/c/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/c/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/cmake/injections.scm b/runtime/queries/cmake/injections.scm new file mode 100644 index 00000000..6cb6c254 --- /dev/null +++ b/runtime/queries/cmake/injections.scm @@ -0,0 +1,4 @@ +((line_comment) @injection.content + (#set! injection.language "comment")) +((bracket_comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/cpp/injections.scm b/runtime/queries/cpp/injections.scm new file mode 100644 index 00000000..a5a5208c --- /dev/null +++ b/runtime/queries/cpp/injections.scm @@ -0,0 +1 @@ +; inherits: c diff --git a/runtime/queries/glsl/injections.scm b/runtime/queries/glsl/injections.scm index b01b8b4b..6330ea3e 100644 --- a/runtime/queries/glsl/injections.scm +++ b/runtime/queries/glsl/injections.scm @@ -1,5 +1,4 @@ +; inherits: c + ((preproc_arg) @injection.content (#set! injection.language "glsl")) - -((comment) @injection.content - (#set! injection.language "comment")) diff --git a/runtime/queries/llvm/injections.scm b/runtime/queries/llvm/injections.scm new file mode 100644 index 00000000..321c90ad --- /dev/null +++ b/runtime/queries/llvm/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) -- cgit v1.2.3-70-g09d2