diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 79f3a6964..1e6cae8f5 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -134,6 +134,7 @@ | move | ✓ | | | | | msbuild | ✓ | | ✓ | | | nasm | ✓ | ✓ | | | +| nginx | ✓ | | | | | nickel | ✓ | | ✓ | `nls` | | nim | ✓ | ✓ | ✓ | `nimlangserver` | | nix | ✓ | ✓ | | `nil`, `nixd` | diff --git a/languages.toml b/languages.toml index 806aa815e..1e8dd3f8b 100644 --- a/languages.toml +++ b/languages.toml @@ -3810,3 +3810,17 @@ language-servers = ["circom-lsp"] [[grammar]] name = "circom" source = { git = "https://github.com/Decurity/tree-sitter-circom", rev = "02150524228b1e6afef96949f2d6b7cc0aaf999e" } + +[[language]] +name = "nginx" +scope = "source.nginx" +injection-regex = "nginx" +file-types = ["conf"] +roots = [] +comment-token = "#" +indent = { tab-width = 4, unit = " " } +auto-format = false + +[[grammar]] +name = "nginx" +source = { git = "https://gitlab.com/joncoole/tree-sitter-nginx", rev = "b4b61db443602b69410ab469c122c01b1e685aa0" } diff --git a/runtime/queries/nginx/highlights.scm b/runtime/queries/nginx/highlights.scm new file mode 100644 index 000000000..67c678a90 --- /dev/null +++ b/runtime/queries/nginx/highlights.scm @@ -0,0 +1,44 @@ +(comment) @comment + +(number) @number +(metric) @number + +(regex) @regex + +(variable) @variable + +(modifier) @operator + +(simple_directive + name: (directive) @function) + +(block_directive + name: (directive) @function) + +(lua_block_directive + "access_by_lua_block" @function) + +((generic) @constant.builtin + (#match? @constant.builtin "^(off|on)$")) + +(generic) @string +(string) @string + +(scheme) @string +(ipv4) @number + +[ + ";" +] @delimiter + +[ + "{" + "}" + "(" + ")" + "[" + "]" +] @punctuation.bracket + +; Lua Debug +(lua_code) @definition.type diff --git a/runtime/queries/nginx/injections.scm b/runtime/queries/nginx/injections.scm new file mode 100644 index 000000000..1c89f46b8 --- /dev/null +++ b/runtime/queries/nginx/injections.scm @@ -0,0 +1,4 @@ +; Script tags +((lua_code) @injection.content + (#set! injection.language "lua") + (#set! injection.combined))