feat: Nginx support (#12309)

Co-authored-by: Denis Gruzdev <codingjerk@gmail.com>
This commit is contained in:
Nikita Revenco 2024-12-24 19:22:29 +00:00 committed by GitHub
parent 9e77c44b38
commit 0fd4a4aae2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 73 additions and 0 deletions

View File

@ -140,6 +140,7 @@
| msbuild | ✓ | | ✓ | |
| nasm | ✓ | ✓ | | |
| nestedtext | ✓ | ✓ | ✓ | |
| nginx | ✓ | | | |
| nickel | ✓ | | ✓ | `nls` |
| nim | ✓ | ✓ | ✓ | `nimlangserver` |
| nix | ✓ | ✓ | | `nil`, `nixd` |

View File

@ -4004,3 +4004,21 @@ indent = { tab-width = 4, unit = " " }
[[grammar]]
name = "vento"
source = { git = "https://github.com/ventojs/tree-sitter-vento", rev = "3321077d7446c1b3b017c294fd56ce028ed817fe" }
[[language]]
name = "nginx"
scope = "source.nginx"
injection-regex = "nginx"
file-types = [
{ glob = "sites-available/*.conf" },
{ glob = "sites-enabled/*.conf" },
{ glob = "nginx.conf" },
{ glob = "conf.d/*.conf" }
]
roots = ["nginx.conf"]
comment-token = "#"
indent = { tab-width = 4, unit = " " }
[[grammar]]
name = "nginx"
source = { git = "https://gitlab.com/joncoole/tree-sitter-nginx", rev = "b4b61db443602b69410ab469c122c01b1e685aa0" }

View File

@ -0,0 +1,45 @@
(comment) @comment
(block_directive
(directive) @type)
[
"{"
"}"
"("
")"
"["
"]"
] @punctuation.bracket
(simple_directive
(directive) @function)
[
";"
] @punctuation.delimiter
((generic) @keyword
(#any-of? @keyword
"on"
"off"
"any"
"auto"))
(modifier) @operator
(generic) @variable
(string) @string
(number) @constant.numeric
(metric) @constant.numeric
(variable) @variable.parameter
(regex) @string
(modifier) @keyword.operator
(lua_block_directive
"access_by_lua_block" @function)

View File

@ -0,0 +1,9 @@
((lua_code) @injection.content
(#set! injection.language "lua")
(#set! injection.combined))
((regex) @injection.content
(#set! injection.language "regex"))
((comment) @injection.content
(#set! injection.language "comment"))