A Visual Studio Code extension that helps you write Nginx configuration files. Many features in it include syntax highlight, auto-complete, in-editor documents, embedded Lua block, and more.
Note
This extension is a fork of hangxingliu/vscode-nginx-conf-hint.
This fork exists and is being maintains because there is compatibility issue with the raynigon.nginx-formatter
extension which comes from the fact that the upstream projects uses NGINX
as language id while the formatter extension uses nginx
and it's not possible to have both extensions on the same file.
- There are some issues with the formatting functionality of this extension (#4, #7). As a workaround, you can use
raynigon.nginx-formatter
extension to format your nginx configuration files.This is not a complete solution, since the formatter extension also has some issues like raynigon/vscode-nginx-formatter#207
- Click
Extension
button in left side of VSCode. (Shortcut: Ctrl+Shift+X or Command+Shift+X) - Search for
ahmadalli.vscode-nginx-conf
and click theInstall
button. - Reload VSCode.
- Syntax highlight for Nginx configuration file
- Support syntax of Lua block in Nginx configuration file
- Autocomplete directives, variables, location, media types, path, and more
- Hint directive arguments and usage
- Provide Nginx snippets
- Provide directives and snippets from OpenResty
- Menu item "Goto Nginx Document" for display related Nginx document in the editor
- Update hint data to Dec 5th, 2023. @AdrianDsg
- Nginx directives
- Lua Resty directives
- HTTP headers
- MIME types
- Add completion for HTTP headers
- Add two file extension names
.conf.default
and.conf.template
. @halilim - Fix syntax for constant values, language keywords
- Update Nginx beautifier
📣 There are a lot of updates in this version:
- The syntax of the Nginx configuration file is updated completely
- Because the syntax from sublime extension and shanoor's repo are long time no updates. So I write a syntax generator for better highlight
- New syntax is generated from codes. You can find them in generate-tmLanguage.ts
- New syntax supports embedded Lua block
- New syntax supports the directive statement in multiple lines
- And extension configuration
nginx-conf-hint.syntax
is removed
- Optimize hint data loader and document loader. They use less memory now and load data on demand
- This extension can run as a web extension. So you can use this extension on https://vscode.dev/ now
- The coverage of auto-completion is more, and auto-completion is smarter
- Auto completion is based on the context and grammar of the configuration now
- Fix some wrong auto-completion items
- Autocomplete named location
- Autocomplete directive's named argument
- Autocomplete media types
- Add editor definition support for
location
directive - Add new extension configuration
nginx-conf-hint.externalModules
for controlling enabled of external modules hint data - The source code is rewritten by using Typescript
- Icon image of this extension is from extension nginx.conf
- This project uses the file src/libs/nginxbeautifier.js from https://github.com/vasilevich/nginxbeautifier
- This extension is published under the GPL-3.0 license
Please check out the document CONTRIBUTING.md for information about building/contributing this project
LiuYue(hangxingliu): Author of the Original Project
- Adrian Dischinger: Contributor of the Original Project
- Halil Özgür: Contributor of the Original Project
- @tiansin: Contributor of the Original Project
- @latipun7: Contributor of the Original Project