diff options
| author | Vladimir Levin <34550675+opa-oz@users.noreply.github.com> | 2025-03-24 01:04:41 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-23 16:04:41 +0000 |
| commit | 9399bfd816f7193b6fa801169f6a907afdd66e5c (patch) | |
| tree | ffb6a0d96daccd987c69f3d72b8085ab481faf29 | |
| parent | bot(readme): update (diff) | |
| download | nvim-treesitter-9399bfd816f7193b6fa801169f6a907afdd66e5c.tar nvim-treesitter-9399bfd816f7193b6fa801169f6a907afdd66e5c.tar.gz nvim-treesitter-9399bfd816f7193b6fa801169f6a907afdd66e5c.tar.bz2 nvim-treesitter-9399bfd816f7193b6fa801169f6a907afdd66e5c.tar.lz nvim-treesitter-9399bfd816f7193b6fa801169f6a907afdd66e5c.tar.xz nvim-treesitter-9399bfd816f7193b6fa801169f6a907afdd66e5c.tar.zst nvim-treesitter-9399bfd816f7193b6fa801169f6a907afdd66e5c.zip | |
feat(caddy): add parser and queries (#7588)
---------
Co-authored-by: Christian Clason <c.clason@uni-graz.at>
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | lockfile.json | 3 | ||||
| -rw-r--r-- | lua/nvim-treesitter/parsers.lua | 8 | ||||
| -rw-r--r-- | queries/caddy/folds.scm | 1 | ||||
| -rw-r--r-- | queries/caddy/highlights.scm | 55 | ||||
| -rw-r--r-- | queries/caddy/indents.scm | 8 | ||||
| -rw-r--r-- | queries/caddy/injections.scm | 2 |
7 files changed, 78 insertions, 0 deletions
@@ -193,6 +193,7 @@ We are looking for maintainers to add more parsers and to write query files for - [x] [bp](https://github.com/ambroisie/tree-sitter-bp) (maintained by @ambroisie) - [x] [c](https://github.com/tree-sitter/tree-sitter-c) (maintained by @amaanq) - [x] [c_sharp](https://github.com/tree-sitter/tree-sitter-c-sharp) (maintained by @amaanq) +- [x] [caddy](https://github.com/opa-oz/tree-sitter-caddy) (maintained by @opa-oz) - [x] [cairo](https://github.com/amaanq/tree-sitter-cairo) (maintained by @amaanq) - [x] [capnp](https://github.com/amaanq/tree-sitter-capnp) (maintained by @amaanq) - [x] [chatito](https://github.com/ObserverOfTime/tree-sitter-chatito) (maintained by @ObserverOfTime) diff --git a/lockfile.json b/lockfile.json index 46dca3835..a230a95e5 100644 --- a/lockfile.json +++ b/lockfile.json @@ -59,6 +59,9 @@ "c_sharp": { "revision": "b5eb5742f6a7e9438bee22ce8026d6b927be2cd7" }, + "caddy": { + "revision": "2686186edb61be47960431c93a204fb249681360" + }, "cairo": { "revision": "6238f609bea233040fe927858156dee5515a0745" }, diff --git a/lua/nvim-treesitter/parsers.lua b/lua/nvim-treesitter/parsers.lua index b4bbf751d..edbc003d5 100644 --- a/lua/nvim-treesitter/parsers.lua +++ b/lua/nvim-treesitter/parsers.lua @@ -233,6 +233,14 @@ list.c_sharp = { maintainers = { "@amaanq" }, } +list.caddy = { + install_info = { + url = "https://github.com/opa-oz/tree-sitter-caddy", + files = { "src/parser.c", "src/scanner.c" }, + }, + maintainers = { "@opa-oz" }, +} + list.cairo = { install_info = { url = "https://github.com/amaanq/tree-sitter-cairo", diff --git a/queries/caddy/folds.scm b/queries/caddy/folds.scm new file mode 100644 index 000000000..fd7d23999 --- /dev/null +++ b/queries/caddy/folds.scm @@ -0,0 +1 @@ +(block) @fold diff --git a/queries/caddy/highlights.scm b/queries/caddy/highlights.scm new file mode 100644 index 000000000..47a170f76 --- /dev/null +++ b/queries/caddy/highlights.scm @@ -0,0 +1,55 @@ +(comment) @comment @spell + +[ + (env) + (argv) + (block_variable) + (placeholder) +] @constant + +(value) @variable + +(directive + (keyword) @attribute) + +(global_options + (option + (keyword) @attribute)) + +(keyword) @keyword + +(boolean) @boolean + +(placeholder + [ + "{" + "}" + ] @punctuation.special) + +(auto) @variable.builtin + +[ + (string_literal) + (quoted_string_literal) + (address) +] @string + +[ + (matcher) + (route) + (snippet_name) +] @string.special + +[ + (numeric_literal) + (time) + (size) + (ip_literal) +] @number + +[ + "{" + "}" +] @punctuation.bracket + +"," @punctuation.delimiter diff --git a/queries/caddy/indents.scm b/queries/caddy/indents.scm new file mode 100644 index 000000000..b746788ab --- /dev/null +++ b/queries/caddy/indents.scm @@ -0,0 +1,8 @@ +(block) @indent.begin + +(block + "}" @indent.branch) + +(comment) @indent.auto + +(ERROR) @indent.auto diff --git a/queries/caddy/injections.scm b/queries/caddy/injections.scm new file mode 100644 index 000000000..2f0e58eb6 --- /dev/null +++ b/queries/caddy/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) |
