From 118a87f7e7fecd91c3661c29d4014d529a27b86d Mon Sep 17 00:00:00 2001 From: gbprod Date: Thu, 24 Nov 2022 08:54:54 +0100 Subject: feat: add gitcommit parser --- queries/gitcommit/highlights.scm | 33 +++++++++++++++++++++++++++++++++ queries/gitcommit/injections.scm | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 queries/gitcommit/highlights.scm create mode 100644 queries/gitcommit/injections.scm (limited to 'queries/gitcommit') diff --git a/queries/gitcommit/highlights.scm b/queries/gitcommit/highlights.scm new file mode 100644 index 000000000..c44428b0a --- /dev/null +++ b/queries/gitcommit/highlights.scm @@ -0,0 +1,33 @@ +(comment) @comment +(generated_comment) @comment +(title) @text.title +(text) @text +(branch) @text.reference +(change) @keyword +(filepath) @text.uri +(arrow) @punctuation.delimiter + +(subject) @text.title +(subject (overflow) @text) +(prefix (type) @keyword) +(prefix (scope) @parameter) +(prefix [ + "(" + ")" + ":" +] @punctuation.delimiter) +(prefix [ + "!" +] @punctuation.special) + +(message) @text + +(trailer (token) @label) +(trailer (value) @text) + +(breaking_change (token) @text.warning) +(breaking_change (value) @text) + +(scissor) @comment + +(ERROR) @error diff --git a/queries/gitcommit/injections.scm b/queries/gitcommit/injections.scm new file mode 100644 index 000000000..4da902920 --- /dev/null +++ b/queries/gitcommit/injections.scm @@ -0,0 +1,2 @@ +(diff) @diff +(rebase_command) @git_rebase -- cgit v1.2.3-70-g09d2