diff --git a/README.md b/README.md index 3deda85..c3e3c8f 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ [![.github/workflows/ci.yaml](https://github.com/hangxingliu/vscode-nginx-conf-hint/actions/workflows/ci.yaml/badge.svg)](https://github.com/hangxingliu/vscode-nginx-conf-hint/actions/workflows/ci.yaml) -An **experimental** extension. -And the hint data generated from [nginx document web page][nginx-doc] by [scripts][doc-script] -You can report bug or send a feature suggestion in [Github Issues Page][issues]. + +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. + ## Installation -1. Click `Extension` button in left side of VSCode. (Shortcut: Ctrl+Shift+X) +1. Click `Extension` button in left side of VSCode. (Shortcut: Ctrl+Shift+X or Command+Shift+X) 2. Search `nginx.conf hint`. Found this extension and click `Install` button. -3. Reload VSCode. ## Screenshots @@ -18,29 +18,40 @@ You can report bug or send a feature suggestion in [Github Issues Page][issues]. ## Features -1. provide highlight for Nginx configuration file. -2. auto complete nginx directives and embedded variables -3. hint directive default parameters -4. hint directives syntax -5. nginx block snippets -6. "Goto Nginx Document" for each directives and variables +1. Syntax highlight for Nginx configuration file +2. Support syntax of Lua block in Nginx configuration file +3. Autocomplete directives, variables, location, media types, path, and more +4. Hint directive arguments and usage +5. Provide Nginx snippets +6. Provide directives and snippets from [OpenResty](https://github.com/openresty/) +7. Menu item "Goto Nginx Document" for display related Nginx document in the editor ## Changelog - -### 0.3.0 (@todo) - -@todo - -### 0.2.0 (2021-11-14) - -1. update syntax and hint data. - - Contributor: [@latipun7](https://github.com/latipun7) -2. add support for lua module and conf formatter - - Contributor: [@tiansin](https://github.com/tiansin) -3. add `goto nginx document` into tooltip hover (issue#9) - -[CHANGELOG.md][docs/changelog] +### 0.3.0 (2021-11-20) + +:mega: There are a lot of updates in this version: + +1. 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](src/syntax/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 +2. Optimize hint data loader and document loader. They use less memory now and load data on demand +3. This extension can run as a web extension. So you can use this extension on now +4. The coverage of auto-completion is more, and auto-completion is smarter + 1. Auto completion is based on the context and grammar of the configuration now + 2. Fix some wrong auto-completion items + 3. Autocomplete named location + 4. Autocomplete directive's named argument + 5. Autocomplete media types +5. Add editor definition support for `location` directive +6. Add new extension configuration `nginx-conf-hint.externalModules` for controlling enabled of external modules hint data +7. The source code is rewritten by using Typescript + +[CHANGELOG.md](docs/CHANGELOG.md) +[更新日志](docs/CHANGELOG.zh-Hans.md) ## Declaration diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index b2dcc75..974ff21 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,8 +1,27 @@ # CHANGELOG -### 0.3.0 (@todo) +### 0.3.0 (2021-11-20) + +:mega: There are a lot of updates in this version: + +1. 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](../src/syntax/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 +2. Optimize hint data loader and document loader. They use less memory now and load data on demand +3. This extension can run as a web extension. So you can use this extension on now +4. The coverage of auto-completion is more, and auto-completion is smarter + 1. Auto completion is based on the context and grammar of the configuration now + 2. Fix some wrong auto-completion items + 3. Autocomplete named location + 4. Autocomplete directive's named argument + 5. Autocomplete media types +5. Add editor definition support for `location` directive +6. Add new extension configuration `nginx-conf-hint.externalModules` for controlling enabled of external modules hint data +7. The source code is rewritten by using Typescript -@todo ### 0.2.0 (2021-11-14) diff --git a/docs/CHANGELOG.zh-Hans.md b/docs/CHANGELOG.zh-Hans.md new file mode 100644 index 0000000..bcc3c09 --- /dev/null +++ b/docs/CHANGELOG.zh-Hans.md @@ -0,0 +1,23 @@ +# CHANGELOG + +### 0.3.0 (2021-11-20) + +:mega: 这个版本更新了很多东西: + +1. 从头到尾更新了 Nginx 配置文件的语法高亮(tmLanguage) + - 因为之前使用来自 Sublime 插件和 Shanoor 仓库的语法已经很久没人更新了, 所以为了更好的代码高亮我写了一个新的语法 + - 新的语法是通过代码来生成的. 相关代码在这儿: [generate-tmLanguage.ts](../src/syntax/generate-tmLanguage.ts) + - 新的语法支持嵌入在 Nginx 配置文件中的 Lua 脚本块 + - 新的语法支持一个 Nginx 配置项写在多行 + - 旧的语法配置 `nginx-conf-hint.syntax` 被移除了 +2. 优化了提示数据和文档数据的加载. 现在按需加载他们, 减少了内存使用 +3. 这个插件兼容 Web 插件, 所以你可以在 上使用这个插件 +4. 能自动补全的地方更多了, 并且新版的自动补全更加智能了 + 1. 现在的自动补全是基于 Nginx 配置文件的语法和上下文来给出的 + 2. 修复了之前许多错误的补全内容 + 3. 可以自动补全命名了的 `location` + 4. 可以自动补全配置的参数 + 5. 可以自动补全媒体类型 +5. 支持了 `location` 的定义与使用间跳转 +6. 添加了新的配置 `nginx-conf-hint.externalModules`, 可以用来控制是否开启 Nginx 外置的模块的补全 +7. 这个插件现在是使用 Typescript 实现的了 diff --git a/package.json b/package.json index 3776dbe..7098159 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vscode-nginx-conf-hint", "displayName": "nginx.conf hint", - "description": "nginx.conf syntax, hint and autocompletion", + "description": "Nginx configuration helper for Visual Studio Code with many features including syntax highlight, auto-complete, in-editor documents, embedded Lua block, and more", "version": "0.3.0", "license": "GPL-3.0", "icon": "images/icon.png", @@ -11,14 +11,14 @@ }, "categories": [ "Snippets", + "Formatters", "Programming Languages" ], "keywords": [ - "NGINX", - "nginx", - "hint", - "auto-completion", - "configuration" + "Nginx", + "OpenResty", + "Configuration", + "Auto-completion" ], "publisher": "hangxingliu", "author": "hangxingliu", @@ -113,24 +113,22 @@ ], "configuration": [ { - "title": "Nginx config file hint", + "title": "Nginx configuration", "properties": { "nginx-conf-hint.enableStrictCompletion": { + "title": "Strict Completion", "type": "boolean", "default": true, "description": "only complete directives related to the block where cursor is located" }, "nginx-conf-hint.format.align": { + "title": "Alignment", "type": "boolean", "default": false, "description": "Set whether to perform alignment formatting" }, - "nginx-conf-hint.enableCodeLens": { - "type": "boolean", - "default": false, - "description": "Enable code lens for describe configuration" - }, "nginx-conf-hint.externalModules": { + "title": "Nginx external modules", "type": "array", "items": { "enum": [ @@ -139,7 +137,7 @@ ] }, "default": [], - "description": "Enabled external modules" + "description": "Enabled hint data for external modules (lua,js)" } } } diff --git a/src/extension/providers/config.ts b/src/extension/providers/config.ts index 36459bf..c7b869b 100644 --- a/src/extension/providers/config.ts +++ b/src/extension/providers/config.ts @@ -5,7 +5,6 @@ export class ExtensionConfiguration { //#region vscode configurations enableStrictCompletion = true; - enableCodeLens = false; enableFormatAlign = false; externalModules: ExternalModuleName[] = []; tabSize = 4; @@ -18,7 +17,6 @@ export class ExtensionConfiguration { const config = workspace.getConfiguration('nginx-conf-hint'); this.enableStrictCompletion = config.get('enableStrictCompletion', true); - this.enableCodeLens = config.get('enableCodeLens', false); this.enableFormatAlign = !!config.get('format', { align: false }).align; this.externalModules = config.get('externalModules', []); this.tabSize = workspace.getConfiguration("editor").get("tabSize", 4);