mirror of
https://github.com/helix-editor/helix.git
synced 2025-01-18 13:07:06 +04:00
feat: Nginx support (#12309)
Co-authored-by: Denis Gruzdev <codingjerk@gmail.com>
This commit is contained in:
parent
9e77c44b38
commit
0fd4a4aae2
@ -140,6 +140,7 @@
|
||||
| msbuild | ✓ | | ✓ | |
|
||||
| nasm | ✓ | ✓ | | |
|
||||
| nestedtext | ✓ | ✓ | ✓ | |
|
||||
| nginx | ✓ | | | |
|
||||
| nickel | ✓ | | ✓ | `nls` |
|
||||
| nim | ✓ | ✓ | ✓ | `nimlangserver` |
|
||||
| nix | ✓ | ✓ | | `nil`, `nixd` |
|
||||
|
@ -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" }
|
||||
|
45
runtime/queries/nginx/highlights.scm
Normal file
45
runtime/queries/nginx/highlights.scm
Normal 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)
|
9
runtime/queries/nginx/injections.scm
Normal file
9
runtime/queries/nginx/injections.scm
Normal 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"))
|
Loading…
Reference in New Issue
Block a user