summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-11-23 20:21:40 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-11-23 20:21:40 +0800
commite9cdb586b2fd0bef19c6bdf23057d62c1a987ae5 (patch)
treed53f1dd0f4af1f0b223e1ce2e1ba7bbe3077e08b
parent9c0651c0fadc9cc968b116ea21a133c1e9839a4a (diff)
downloadlua-language-server-e9cdb586b2fd0bef19c6bdf23057d62c1a987ae5.zip
resolve #720
-rw-r--r--changelog.md2
-rw-r--r--test/type_inference/init.lua34
2 files changed, 35 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index e3d9dff3..f569a9dd 100644
--- a/changelog.md
+++ b/changelog.md
@@ -6,7 +6,7 @@
+ `Lua.hint.await`: display `await` when calling a function marked as async
* `NEW` add supports for `lovr`
* `NEW` file encoding supports `utf16le` and `utf16be`
-* `NEW` completion supports table fields in calling, see [#727](https://github.com/sumneko/lua-language-server/issues/727)
+* `NEW` full IntelliSense supports for literal tables, see [#720](https://github.com/sumneko/lua-language-server/issues/720) and [#727](https://github.com/sumneko/lua-language-server/issues/727)
* `NEW` `LuaDoc` annotations:
+ `---@async`: mark a function as async
+ `---@nodiscard`: the return value of the marking function cannot be discarded
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index b48d0700..36357771 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1019,3 +1019,37 @@ mt:loop(function (<?i?>)
end)
]]
+
+TEST 'integer' [[
+---@class D
+---@field y integer # D comment
+
+---@class C
+---@field x integer # C comment
+---@field d D
+
+---@param c C
+local function f(c) end
+
+f {
+ <?x?> = ,
+}
+]]
+
+TEST 'integer' [[
+---@class D
+---@field y integer # D comment
+
+---@class C
+---@field x integer # C comment
+---@field d D
+
+---@param c C
+local function f(c) end
+
+f {
+ d = {
+ <?y?> = ,
+ }
+}
+]]