|
3 | 3 | *All notable changes to the EmmyLua Analyzer Rust project will be documented in this file.* |
4 | 4 |
|
5 | 5 | --- |
6 | | -## [0.15.0] - Unreleased |
| 6 | +## [0.17.0] - Unreleased |
7 | 7 |
|
8 | 8 | ### 🔧 Changed |
9 | 9 | - **Refactor IndexAliasName**: 删除原先的索引别名实现(`-- [IndexAliasName]`), 现在使用`---@[index_alias("name")]` |
| 10 | +- **Refactor ClassDefaultCall**: 删除配置项`runtime.class_default_call`, 转为使用`---@[constructor("<constructor_method_name>")]` |
10 | 11 |
|
11 | 12 | ### ✨ Added |
12 | | -- **Attribute**: 实现了新的特性`---@attribute`,用于定义附加元数据,内置三个特性: |
| 13 | +- **Attribute**: 实现了新的特性`---@attribute`,用于定义附加元数据,内置多个特性: |
13 | 14 | ```lua |
14 | 15 | --- Deprecated. Receives an optional message parameter. |
15 | 16 | ---@attribute deprecated(message: string?) |
16 | 17 |
|
17 | | ---- Skip partial diagnostics, typically used to optimize diagnostic performance. |
| 18 | +--- Language Server Performance Optimization Items. |
18 | 19 | --- |
19 | 20 | --- Receives a parameter, the options are: |
20 | | ---- - `table_field` - Skip diagnostic for `table` fields |
21 | | ----@attribute skip_diagnostic(code: string) |
| 21 | +--- - `check_table_field` - Skip the assign check for table fields. It is recommended to use this option for all large configuration tables. |
| 22 | +---@attribute lsp_perf_optim(code: "check_table_field"|string) |
22 | 23 |
|
23 | 24 | --- Index field alias, will be displayed in `hint` and `completion`. |
24 | 25 | --- |
25 | 26 | --- Receives a string parameter for the alias name. |
26 | 27 | ---@attribute index_alias(name: string) |
| 28 | + |
| 29 | +--- This attribute must be applied to function parameters, and the function parameter's type must be a string template generic, |
| 30 | +--- used to specify the default constructor of a class. |
| 31 | +--- |
| 32 | +--- Parameters: |
| 33 | +--- - `name` - The name of the method as a constructor. |
| 34 | +--- - `root_class` - Used to mark the root class, will implicitly inherit this class, such as `System.Object` in c#. Defaults to empty. |
| 35 | +--- - `strip_self` - Whether the `self` parameter can be omitted when calling the constructor, defaults to `true` |
| 36 | +--- - `return_self` - Whether the constructor is forced to return `self`, defaults to `true` |
| 37 | +---@attribute constructor(name: string, root_class: string?, strip_self: boolean?, return_self: boolean?) |
| 38 | + |
| 39 | +--- Associates `getter` and `setter` methods with a field. Currently provides only definition navigation functionality, |
| 40 | +--- and the target methods must reside within the same class. |
| 41 | +--- |
| 42 | +--- Parameters: |
| 43 | +--- - convention: Naming convention, defaults to `camelCase`. Implicitly adds `get` and `set` prefixes. eg: `_age` -> `getAge`, `setAge`. |
| 44 | +--- - getter: Getter method name. Takes precedence over `convention`. |
| 45 | +--- - setter: Setter method name. Takes precedence over `convention`. |
| 46 | +---@attribute field_accessor(convention: "camelCase"|"PascalCase"|"snake_case"|nil, getter: string?, setter: string?) |
27 | 47 | ``` |
28 | 48 |
|
29 | 49 | 使用语法为 `---@[attribute_name_1(arg...), attribute_name_2(arg...), ...]`, 可以同时使用多个特性, 示例: |
|
0 commit comments