Skip to content

Commit 41028ab

Browse files
committed
update version
1 parent 0e83136 commit 41028ab

File tree

7 files changed

+153
-37
lines changed

7 files changed

+153
-37
lines changed

CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,66 @@
22

33
[中文Log](CHANGELOG_CN.md)
44

5+
## [0.9.29] - 2025-9-19
6+
7+
### 🔧 Changed
8+
9+
- **Refactor LSP Handler**: Refactored LSP handler to improve performance and maintainability.
10+
- **Refactor Folding Range**: Refactored folding range to support `Intellij`
11+
- **Add More Semantic Token**: Added more semantic tokens to improve syntax highlighting.
12+
- **Parser Optimization**: The parser now reports syntax errors more accurately and has improved error recovery.
13+
- **@type Support for Return Statements**: You can now use `@type` above a return statement to specify the return value type, for example:
14+
```lua
15+
---@return vim.lsp.Config
16+
return {}
17+
```
18+
- **Type Checking Optimization**: Improved type checking algorithms for better performance.
19+
20+
### 🐛 Fixed
21+
- **Fix create progress**: Fixed an issue with the `window/workDoneProgress/create` protocol; it must be sent as a request, not a notification.
22+
- **Fix Function Overload Algorithm**: Rewrote the function overload algorithm to better handle variadic function parameters.
23+
- **LSP Handler Order**: Fixed an issue where LSP request donot handle during initialization.it will be handle after initialization complete.
24+
25+
### ✨ Added
26+
- **Support @link in comment**: You can now use `@link` in comments to create clickable links. For example:
27+
```lua
28+
--- This is a link to {@link string.format}
29+
```
30+
- **Support `--editor` directive**: You can now use the `--editor` directive to specify the editor type. For example:
31+
```shell
32+
emmylua_ls --editor intellij
33+
```
34+
- **Support range foramt for external tool**: You can now use the `rangeFormat` request to format a specific range of code using an external tool. This feature can be enabled with the following configuration:
35+
```json
36+
{
37+
"format": {
38+
"externalToolRangeFormat": {
39+
"program": "stylua",
40+
"args": [
41+
"-",
42+
"--stdin-filepath",
43+
"${file}",
44+
"--indent-width=${indent_size}",
45+
"--indent-type",
46+
"${use_tabs?Tabs:Spaces}",
47+
"--range-start=${start_offset}",
48+
"--range-end=${end_offset}"
49+
],
50+
"timeout": 5000
51+
}
52+
}
53+
}
54+
```
55+
for more information, please refer to [External Formatter Options](https://github.com/EmmyLuaLs/emmylua-analyzer-rust/blob/main/docs/external_format/external_formatter_options_EN.md).
56+
- **Add Basic EmmyLua Annotation Documentation**: Added more documentation for EmmyLua annotations, please refer to [EmmyLua Annotation Documentation](https://github.com/EmmyLuaLs/emmylua-analyzer-rust/blob/main/docs/emmylua_doc/annotations_EN/README.md).
57+
58+
- **SARIF Format for emmyLua_check**: `emmyLua_check` now supports SARIF format output, enabled via the `--format sarif` command line option.
59+
- **Generic List Supports T... Syntax**: Generic lists now support the `T...` syntax, for example:
60+
```lua
61+
---@alias MyTuple<T...> [T...]
62+
```
63+
64+
565
## [0.9.28] - 2025-8-22
666

767
### 🐛 Fixed

CHANGELOG_CN.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,65 @@
11
# 🚀 Change Log
22

3+
## [0.9.29] - 2025-9-19
4+
5+
### 🔧 变更
6+
7+
- **重构 LSP 处理器**:重构了 LSP 处理器以提升性能和可维护性。
8+
- **重构折叠区间**:折叠区间功能已重构,现支持 `Intellij`
9+
- **新增语义标记**:增加了更多语义标记以提升语法高亮效果。
10+
- **解析器优化**:解析器现在能更准确地报告语法错误,并提升了错误恢复能力。
11+
- **支持返回语句上的 @type**:现在可以在 return 语句上方使用 `@type` 指定返回值类型,例如:
12+
```lua
13+
---@return vim.lsp.Config
14+
return {}
15+
```
16+
- **类型检查优化**:优化了类型检查算法,提升了性能。
17+
18+
### 🐛 问题修复
19+
- **修复进度创建协议**:修复了 `window/workDoneProgress/create` 协议,必须以请求方式发送而非通知。
20+
- **修复函数重载算法**:重写了函数重载算法,更好地处理可变参数函数。
21+
- **LSP 处理顺序修复**:修复了初始化期间 LSP 请求未处理的问题,现会在初始化完成后处理。
22+
23+
### ✨ 新增功能
24+
- **支持注释中的 @link**:现在可以在注释中使用 `@link` 创建可点击链接,例如:
25+
```lua
26+
--- 这是一个指向 {@link string.format} 的链接
27+
```
28+
- **支持 `--editor` 指令**:现在可以使用 `--editor` 指定编辑器类型,例如:
29+
```shell
30+
emmylua_ls --editor intellij
31+
```
32+
- **支持外部工具区间格式化**:现在可以通过 `rangeFormat` 请求,使用外部工具格式化指定代码区间。可通过如下配置启用:
33+
```json
34+
{
35+
"format": {
36+
"externalToolRangeFormat": {
37+
"program": "stylua",
38+
"args": [
39+
"-",
40+
"--stdin-filepath",
41+
"${file}",
42+
"--indent-width=${indent_size}",
43+
"--indent-type",
44+
"${use_tabs?Tabs:Spaces}",
45+
"--range-start=${start_offset}",
46+
"--range-end=${end_offset}"
47+
],
48+
"timeout": 5000
49+
}
50+
}
51+
}
52+
```
53+
更多信息请参考 [外部格式化工具选项](https://github.com/EmmyLuaLs/emmylua-analyzer-rust/blob/main/docs/external_format/external_formatter_options_CN.md)
54+
- **新增 EmmyLua 注解文档**:补充了 EmmyLua 注解相关文档,详见 [EmmyLua 注解文档](https://github.com/EmmyLuaLs/emmylua-analyzer-rust/blob/main/docs/emmylua_doc/annotations_CN/README.md)
55+
56+
- **emmyLua_check 支持 SARIF 格式**`emmyLua_check` 现支持 SARIF 格式输出,可通过命令行参数 `--format sarif` 启用。
57+
- **泛型列表支持 T... 语法**:泛型列表现已支持 `T...` 语法,例如:
58+
```lua
59+
---@alias MyTuple<T...> [T...]
60+
```
61+
62+
363
## [0.9.28] - 2025-8-22
464

565
### 🐛 问题修复

build/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"emmyDebuggerVersion": "1.8.7",
33
"emmyDebuggerUrl": "https://github.com/EmmyLua/EmmyLuaDebugger/releases/download",
4-
"newLanguageServerVersion": "0.12.0",
4+
"newLanguageServerVersion": "0.14.0",
55
"newLanguageServerUrl": "https://github.com/CppCXY/emmylua-analyzer-rust/releases/download",
66
"newLanguageServerSchemaUrl": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/refs/tags/{{tag}}/crates/emmylua_code_analysis/resources/schema.json"
77
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "emmylua",
33
"displayName": "EmmyLua",
44
"description": "EmmyLua for vscode",
5-
"version": "0.9.28",
5+
"version": "0.9.29",
66
"icon": "res/icon.png",
77
"publisher": "tangzx",
88
"engines": {

src/emmyContext.ts

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as vscode from 'vscode';
22
import { LanguageClient } from 'vscode-languageclient/node';
3-
import { IProgressReport, ServerStatusParams } from './lspExtension';
3+
import { ServerStatusParams } from './lspExtension';
44

55
type ServerHealth = 'ok' | 'warning' | 'error' | 'stop';
66

@@ -16,18 +16,15 @@ export class EmmyContext implements vscode.Disposable {
1616

1717
private _client?: LanguageClient;
1818
private readonly _statusBar: vscode.StatusBarItem;
19-
private readonly _loadBar: vscode.StatusBarItem;
2019
private readonly _disposables: vscode.Disposable[] = [];
2120

2221
constructor(
2322
public readonly debugMode: boolean,
2423
public readonly vscodeContext: vscode.ExtensionContext,
2524
) {
2625
this._statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
27-
this._loadBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
28-
29-
this._disposables.push(this._statusBar, this._loadBar);
3026

27+
this._disposables.push(this._statusBar);
3128
this.setServerStatus({ health: "ok" });
3229
}
3330

@@ -37,9 +34,6 @@ export class EmmyContext implements vscode.Disposable {
3734

3835
set client(value: LanguageClient | undefined) {
3936
this._client = value;
40-
if (value) {
41-
this.registerProtocol();
42-
}
4337
}
4438

4539
setServerStatus(status: ServerStatusParams): void {
@@ -102,31 +96,6 @@ export class EmmyContext implements vscode.Disposable {
10296
return tooltip;
10397
}
10498

105-
private registerProtocol(): void {
106-
if (!this._client) return;
107-
108-
this._disposables.push(
109-
this._client.onNotification("emmy/progressReport", (data: IProgressReport) => {
110-
this.handleProgressReport(data);
111-
}),
112-
113-
this._client.onNotification("emmy/setServerStatus", (param: ServerStatusParams) => {
114-
this.setServerStatus(param);
115-
})
116-
);
117-
}
118-
119-
private handleProgressReport(data: IProgressReport): void {
120-
this._loadBar.show();
121-
this._loadBar.text = `$(sync~spin) ${data.text}`;
122-
123-
if (data.percent >= 1) {
124-
setTimeout(() => {
125-
this._loadBar.hide();
126-
}, 1000);
127-
}
128-
}
129-
13099
stopServer(): void {
131100
this._client?.stop();
132101
this.setServerStatus({ health: "stop" });

src/extension.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ function onDidChangeActiveTextEditor(editor: vscode.TextEditor | undefined): voi
144144

145145
async function startServer(): Promise<void> {
146146
try {
147+
extensionContext.setServerStatus({ health: 'ok'});
147148
await doStartServer();
148149
onDidChangeActiveTextEditor(vscode.window.activeTextEditor);
149150
} catch (reason) {

syntaxes/schema.json

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"$ref": "#/$defs/EmmyrcReformat",
6565
"default": {
6666
"externalTool": null,
67+
"externalToolRangeFormat": null,
6768
"useDiff": false
6869
}
6970
},
@@ -82,6 +83,7 @@
8283
"hover": {
8384
"$ref": "#/$defs/EmmyrcHover",
8485
"default": {
86+
"customDetail": null,
8587
"enable": true
8688
}
8789
},
@@ -678,6 +680,7 @@
678680
"default": ""
679681
},
680682
"timeout": {
683+
"description": "The timeout for the external tool in milliseconds.",
681684
"type": "integer",
682685
"format": "uint64",
683686
"default": 5000,
@@ -717,6 +720,17 @@
717720
"EmmyrcHover": {
718721
"type": "object",
719722
"properties": {
723+
"customDetail": {
724+
"description": "The detail number of hover information.\nDefault is `None`, which means using the default detail level.\nYou can set it to a number between `1` and `255` to customize",
725+
"type": [
726+
"integer",
727+
"null"
728+
],
729+
"format": "uint8",
730+
"default": null,
731+
"maximum": 255,
732+
"minimum": 0
733+
},
720734
"enable": {
721735
"description": "Enable showing documentation on hover.",
722736
"type": "boolean",
@@ -873,7 +887,19 @@
873887
"type": "object",
874888
"properties": {
875889
"externalTool": {
876-
"description": "Whether to enable internal code reformatting.",
890+
"description": "Whether to enable external tool formatting.",
891+
"anyOf": [
892+
{
893+
"$ref": "#/$defs/EmmyrcExternalTool"
894+
},
895+
{
896+
"type": "null"
897+
}
898+
],
899+
"default": null
900+
},
901+
"externalToolRangeFormat": {
902+
"description": "Whether to enable external tool range formatting.",
877903
"anyOf": [
878904
{
879905
"$ref": "#/$defs/EmmyrcExternalTool"
@@ -1122,4 +1148,4 @@
11221148
]
11231149
}
11241150
}
1125-
}
1151+
}

0 commit comments

Comments
 (0)