|
3 | 3 | *All notable changes to the EmmyLua Analyzer Rust project will be documented in this file.*
|
4 | 4 |
|
5 | 5 | ---
|
6 |
| -## [0.8.2] - Unreleased |
7 |
| - |
| 6 | +## [0.8.2] - 2025-6-27 |
8 | 7 | ### ✨ Added
|
9 | 8 | - **Support for Descriptions Above and After Tags**: You can now add descriptions both above a tag (as a preceding comment) and after a tag (inline). The description will be associated with the corresponding tag.
|
10 | 9 | ```lua
|
|
16 | 15 | ---@field c integer inline-description
|
17 | 16 | local a = {}
|
18 | 17 | ```
|
| 18 | +- **Add call `__call` hint**: Add call `__call` hint, enable by `hint.metaCallHint` |
| 19 | + ```lua |
| 20 | + ---@class A |
| 21 | + ---@overload fun(a: integer): integer |
| 22 | + local A |
| 23 | + A(1) -- There will be a lightning prompt between `A` and `(` or a `new` prompt before `A` |
| 24 | + ``` |
| 25 | + |
| 26 | +- **Support syntax`--[[@cast -?]]`**: When `@cast` is followed by an operator instead of a name, it will convert the type of the previous expression, but currently only works for function calls! |
| 27 | + |
| 28 | +- **Quick Fix for Nil Removal**: Added quick fix action for `NeedCheckNil` diagnostic that suggests using `@cast` to remove nil type |
| 29 | + ```lua |
| 30 | + ---@Class Cast1 |
| 31 | + ---@field get fun(self: self, a: number): Cast1? |
| 32 | + local A |
| 33 | + |
| 34 | + local _a = A:get(1) --[[@cast -?]]:get(2):get(3) -- Quick fix will prompt whether to automatically add `--[[@cast -?]]` |
| 35 | + ``` |
| 36 | +- **Base Function Name Completion**: Added `completion.baseFunctionIncludesName` configuration to control whether function names are included in base function completions |
| 37 | + ```json |
| 38 | + { |
| 39 | + "completion": { |
| 40 | + "baseFunctionIncludesName": true |
| 41 | + } |
| 42 | + } |
| 43 | + ``` |
| 44 | + When enabled, function completions will include the function name: `function name() end` instead of `function () end` |
| 45 | + |
| 46 | +- **Cast Type Mismatch Diagnostic**: Added new diagnostic `CastTypeMismatch` to detect type mismatches in cast operations |
| 47 | + ```lua |
| 48 | + ---@type string |
| 49 | + local a = "hello" |
| 50 | + --[[@cast a int]] -- Warning |
| 51 | + ``` |
| 52 | + |
| 53 | +- **Auto Require Naming Convention Configuration**: Added `completion.autoRequireNamingConvention.keep-class` configuration option. When importing modules, if the return value is a class definition, the class name will be used; otherwise, the file name will be used |
| 54 | + ```json |
| 55 | + { |
| 56 | + "completion": { |
| 57 | + "autoRequireNamingConvention": "keep-class" |
| 58 | + } |
| 59 | + } |
| 60 | + ``` |
| 61 | + |
| 62 | +- **File rename prompts whether to update `require` paths**: Added prompt when renaming files to ask whether to update corresponding import statements |
| 63 | + |
19 | 64 |
|
20 | 65 | ### 🔧 Changed
|
21 | 66 | - **Class Method Completion**: When a function call jumps, if there are multiple declarations, It will then attempt to return the most matching definition along with all actual code declarations, rather than returning all definitions.
|
22 | 67 |
|
| 68 | +- **Definition Jump Enhancement**: When jumping to definition from function calls, if the target is located in a return statement, the language server will now attempt to find the original definition. For example: |
| 69 | + ```lua |
| 70 | + -- test.lua |
| 71 | + local function test() |
| 72 | + end |
| 73 | + return { |
| 74 | + test = test, |
| 75 | + } |
| 76 | + ``` |
| 77 | + ```lua |
| 78 | + local t = require("test") |
| 79 | + local test = t.test -- Previously jumped to: test = test, |
| 80 | + test() -- Now jumps to: local function test() |
| 81 | + ``` |
| 82 | + |
23 | 83 | ### 🐛 Fixed
|
24 | 84 | - **Enum Variable Parameter Issue**: Fixed a crash issue when checking enum variable as parameter
|
25 | 85 | - **Circle Doc Class Issue**: Fixed a bug that caused the language server to hang when
|
26 | 86 |
|
| 87 | + |
27 | 88 | ## [0.8.1] - 2025-6-14
|
28 | 89 |
|
29 | 90 | ### 🔧 Changed
|
|
0 commit comments