diff --git a/README.md b/README.md index 88ee4d3f1..12faa4d76 100644 --- a/README.md +++ b/README.md @@ -238,6 +238,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [gomod](https://github.com/camdencheek/tree-sitter-go-mod) (maintained by @camdencheek) - [x] [gosum](https://github.com/amaanq/tree-sitter-go-sum) (maintained by @amaanq) - [x] [gowork](https://github.com/omertuc/tree-sitter-go-work) (maintained by @omertuc) +- [x] [gpg](https://github.com/ObserverOfTime/tree-sitter-gpg-config) (maintained by @ObserverOfTime) - [x] [graphql](https://github.com/bkegley/tree-sitter-graphql) (maintained by @bkegley) - [x] [groovy](https://github.com/Decodetalkers/tree-sitter-groovy) (maintained by @Decodetalkers) - [ ] [hack](https://github.com/slackhq/tree-sitter-hack) diff --git a/lockfile.json b/lockfile.json index 15c0298ec..14923f000 100644 --- a/lockfile.json +++ b/lockfile.json @@ -194,6 +194,9 @@ "gowork": { "revision": "949a8a470559543857a62102c84700d291fc984c" }, + "gpg": { + "revision": "af97733568c8141090d8a79dfff66806c96c2cc0" + }, "graphql": { "revision": "5e66e961eee421786bdda8495ed1db045e06b5fe" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index 6bb88ac06..b40113a38 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -623,6 +623,14 @@ list.gowork = { maintainers = { "@omertuc" }, } +list.gpg = { + install_info = { + url = "https://github.com/ObserverOfTime/tree-sitter-gpg-config", + files = { "src/parser.c" }, + }, + maintainers = { "@ObserverOfTime" }, +} + list.groovy = { install_info = { url = "https://github.com/Decodetalkers/tree-sitter-groovy", diff --git a/queries/gpg/highlights.scm b/queries/gpg/highlights.scm new file mode 100644 index 000000000..55833027e --- /dev/null +++ b/queries/gpg/highlights.scm @@ -0,0 +1,49 @@ +(option . _ @keyword) + +(option + ("no-" @parameter)? + (name) @parameter) + +(string (content) @string) + +[ + (value) + "clear" +] @string.special + +(url) @text.uri + +(key) @constant + +[ + (number) + (expire_time) + (iso_time) +] @number + +(format) @character.special + +"sensitive:" @type.qualifier + +(filter_name) @parameter + +(filter_scope) @namespace + +(filter_property) @property + +(filter_value) @string + +[ + (filter_op0) + (filter_op1) + (filter_lc) + "=" +] @operator + +"!" @punctuation.special + +[ "\"" "'" "," ] @punctuation.delimiter + +(comment) @comment @spell + +(ERROR) @error diff --git a/queries/gpg/injections.scm b/queries/gpg/injections.scm new file mode 100644 index 000000000..321c90add --- /dev/null +++ b/queries/gpg/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment"))