File tree Expand file tree Collapse file tree 3 files changed +40
-2
lines changed
Expand file tree Collapse file tree 3 files changed +40
-2
lines changed Original file line number Diff line number Diff line change 11# changelog
22
33## 3.7.5
4+ * ` NEW ` alias and enums supports attribute ` merge `
5+ ``` lua
6+ --- @alias Animal Cat
7+
8+ --- @alias (merge ) Animal Dog
9+
10+ --- @type Animal
11+ local animal -- > animal is `Cat|Dog` here
12+ ```
13+
14+ ``` lua
15+ --- @enum (key ) ErrorCodes
16+ local codes1 = {
17+ OK = 0 ,
18+ ERROR = 1 ,
19+ FATAL = 2 ,
20+ }
21+
22+ --- @enum (key , merge) ErrorCodes
23+ local codes2 = {
24+ WARN = 3 ,
25+ INFO = 4 ,
26+ }
27+
28+ --- @type ErrorCodes
29+ local code
30+
31+ code = ' ERROR' -- > OK
32+ code = ' WARN' -- > OK
33+
34+ ```
435* ` FIX ` rename in library files
536
637## 3.7.4
Original file line number Diff line number Diff line change @@ -1026,7 +1026,7 @@ local docSwitch = util.switch()
10261026 local result = {
10271027 type = ' doc.alias' ,
10281028 }
1029- result .docAttr = parseDocAttr ()
1029+ result .docAttr = parseDocAttr (result )
10301030 result .alias = parseName (' doc.alias.name' , result )
10311031 if not result .alias then
10321032 pushWarning {
Original file line number Diff line number Diff line change @@ -4335,4 +4335,11 @@ end
43354335
43364336local <?x?> = f()
43374337]=]
4338- --
4338+
4339+ TEST ' boolean|number' [[
4340+ ---@alias A number
4341+ ---@alias(merge) A boolean
4342+
4343+ ---@type A
4344+ local <?x?>
4345+ ]]
You can’t perform that action at this time.
0 commit comments