summaryrefslogtreecommitdiff
path: root/runtime/queries/comment
diff options
context:
space:
mode:
authorMichael Davis2021-12-19 14:56:56 +0000
committerGitHub2021-12-19 14:56:56 +0000
commite72786df8eae5684c0330be18f190a33f516da76 (patch)
tree789dbb20133585155cd4554d30c3ef9580bf9434 /runtime/queries/comment
parent7c01d926536bcaacc92bbf4a2b1a06e96e6268a0 (diff)
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 <pickfire@riseup.net>
Diffstat (limited to 'runtime/queries/comment')
-rw-r--r--runtime/queries/comment/highlights.scm30
1 files changed, 30 insertions, 0 deletions
diff --git a/runtime/queries/comment/highlights.scm b/runtime/queries/comment/highlights.scm
new file mode 100644
index 00000000..88685d59
--- /dev/null
+++ b/runtime/queries/comment/highlights.scm
@@ -0,0 +1,30 @@
+[
+ "("
+ ")"
+] @punctuation.bracket
+
+":" @punctuation.delimiter
+
+((tag (name) @warning)
+ (#match? @warning "^(TODO|HACK|WARNING)$"))
+
+("text" @warning
+ (#match? @warning "^(TODO|HACK|WARNING)$"))
+
+((tag (name) @error)
+ (match? @error "^(FIXME|XXX|BUG)$"))
+
+("text" @error
+ (match? @error "^(FIXME|XXX|BUG)$"))
+
+(tag
+ (name) @ui.text
+ (user)? @constant)
+
+; Issue number (#123)
+("text" @constant.numeric
+ (#match? @constant.numeric "^#[0-9]+$"))
+
+; User mention (@user)
+("text" @tag
+ (#match? @tag "^[@][a-zA-Z0-9_-]+$"))