File tree 3 files changed +27
-0
lines changed
3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,16 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
93
93
end
94
94
end
95
95
```
96
+ * ` CHG ` [ #1332 ] infer parameter type when function in table
97
+ ``` lua
98
+ --- @class A
99
+ --- @field f fun ( x : string )
100
+
101
+ --- @type A
102
+ local t = {
103
+ f = function (x ) end -- > `x` is inferred as `string`
104
+ }
105
+ ```
96
106
* ` CHG ` find reference: respect ` includeDeclaration ` (although I don't know how to turn off this option in VSCode)
97
107
* ` FIX ` [ #1567 ]
98
108
* ` FIX ` [ #1593 ]
@@ -107,6 +117,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
107
117
[ #1153 ] : https://github.com./sumneko/lua-language-server/issues/1153
108
118
[ #1177 ] : https://github.com./sumneko/lua-language-server/issues/1177
109
119
[ #1202 ] : https://github.com./sumneko/lua-language-server/issues/1202
120
+ [ #1332 ] : https://github.com./sumneko/lua-language-server/issues/1332
110
121
[ #1458 ] : https://github.com./sumneko/lua-language-server/issues/1458
111
122
[ #1557 ] : https://github.com./sumneko/lua-language-server/issues/1557
112
123
[ #1558 ] : https://github.com./sumneko/lua-language-server/issues/1558
Original file line number Diff line number Diff line change @@ -1108,6 +1108,12 @@ local compilerSwitch = util.switch()
1108
1108
end
1109
1109
end
1110
1110
end
1111
+
1112
+ -- { f = function (<?x?>) end }
1113
+ if source .parent .type == ' tablefield'
1114
+ or source .parent .type == ' tableindex' then
1115
+ vm .setNode (source , vm .compileNode (source .parent ))
1116
+ end
1111
1117
end )
1112
1118
: case ' paren'
1113
1119
: call (function (source )
Original file line number Diff line number Diff line change @@ -3866,3 +3866,13 @@ local function f()
3866
3866
end
3867
3867
end
3868
3868
]]
3869
+
3870
+ TEST ' string' [[
3871
+ ---@class A
3872
+ ---@field f fun(x: string)
3873
+
3874
+ ---@type A
3875
+ local t = {
3876
+ f = function (<?x?>) end
3877
+ }
3878
+ ]]
You can’t perform that action at this time.
0 commit comments